diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 15808fa..c26594e 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -37,8 +37,6 @@ const ( MinSort uint8 = 1 //全局基础最小排序 SIZE = 20 //全局基础每页数 - ProjectSaleId = 8 - ProjectPrintId = 9 DecollatorComma = "," //逗号分割符 DecollatorColon = ":" diff --git a/pkg/validate/defValidator.go b/pkg/validate/defValidator.go index 4fec396..c9399c1 100644 --- a/pkg/validate/defValidator.go +++ b/pkg/validate/defValidator.go @@ -1,14 +1,16 @@ package validate const ( - FieldId = "Id.required" - FieldIdValue = "ID不能为空" - FieldStatus = "Status.required" - FieldStatusValue = "状态不能为空" - FieldTypeIn = "Type.oneof" - FieldTypeInValue = "类型传值不对" - FieldType = "Type.required" - FieldTypeValue = "类型不能为空" + FieldId = "Id.required" + FieldIdValue = "ID不能为空" + FieldStatus = "Status.required" + FieldStatusValue = "状态不能为空" + FieldStatusIn = "Status.oneof" + FieldStatusInValue = "状态不能不对" + FieldTypeIn = "Type.oneof" + FieldTypeInValue = "类型传值不对" + FieldType = "Type.required" + FieldTypeValue = "类型不能为空" ) type StatusValidator struct { diff --git a/rpc/factory/factory.pb b/rpc/factory/factory.pb new file mode 100644 index 0000000..cccf100 Binary files /dev/null and b/rpc/factory/factory.pb differ diff --git a/rpc/factory/factory.proto b/rpc/factory/factory.proto new file mode 100644 index 0000000..d2a0847 --- /dev/null +++ b/rpc/factory/factory.proto @@ -0,0 +1,217 @@ +syntax = "proto3"; + +package factory; +option go_package="./factory"; +import "google/api/annotations.proto"; + + +message GroupCreateRequest { + string name =1; + string account =2; + string password =3; +} + +message GroupEditRequest { + int64 id = 1; + string name =2; + string account =3; + string password =4; +} + +message GroupItemsRequest { + int32 page = 1; + int32 size =2; + int32 status =3; + string name =4; +} + +message GroupPasswordRequest { + int64 id = 1; + string password =2; +} + +message EmptyRequest { +} + +message IdRequest { + int64 id = 1; +} + +message StatusRequest { + int64 id = 1; + int32 status = 2; + string reason = 3; +} + +message Response { + int32 code = 1; + string msg = 2; + string data = 3; +} + +message PostCreateRequest { + string name =1; +} + +message PostEditRequest { + int64 id = 1; + string name =2; +} + +message LogItemsRequest { + int32 page = 1; + int32 size =2; + int32 type =3; + int32 obj_type =4; + repeated string time =5; +} + +message WorkerCreateRequest { + string name =1; + string mobile =2; + string group_id =3; + string post_id = 4; +} + +message WorkerEditRequest { + int64 id = 1; + string name =2; + string mobile =3; + int64 group_id =4; + int64 post_id = 5; +} + +message WorkerItemsRequest { + int32 page = 1; + int32 size =2; + string name =3; + int64 group_id =4; + int64 post_id = 5; + string mobile =6; +} + + +service Factory { + rpc GroupItems(GroupItemsRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/group/items" + body: "*" + }; + }; + rpc GroupInfo(IdRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/group/info" + body: "*" + }; + }; + rpc GroupCreate(GroupCreateRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/group/create" + body: "*" + }; + }; + rpc GroupEdit(GroupEditRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/group/edit" + body: "*" + }; + }; + rpc GroupStatus(StatusRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/group/status" + body: "*" + }; + }; + rpc GroupNames(EmptyRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/group/names" + body: "*" + }; + }; + rpc GroupPassword(GroupPasswordRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/group/password" + body: "*" + }; + }; + + rpc PostItems(EmptyRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/post/items" + body: "*" + }; + }; + rpc PostInfo(IdRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/post/info" + body: "*" + }; + }; + rpc PostCreate(PostCreateRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/post/create" + body: "*" + }; + }; + rpc PostEdit(PostEditRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/post/edit" + body: "*" + }; + }; + rpc PostStatus(StatusRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/post/status" + body: "*" + }; + }; + rpc PostNames(EmptyRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/post/names" + body: "*" + }; + }; + rpc LogItems(LogItemsRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/log/items" + body: "*" + }; + }; + + rpc WorkerCreate(WorkerCreateRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/worker/create" + body: "*" + }; + }; + rpc WorkerEdit(WorkerEditRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/worker/edit" + body: "*" + }; + }; + rpc WorkerStatus(StatusRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/worker/status" + body: "*" + }; + }; + rpc WorkerNames(EmptyRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/worker/names" + body: "*" + }; + }; + rpc WorkerItems(WorkerItemsRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/worker/items" + body: "*" + }; + }; + rpc WorkerInfo(IdRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/worker/info" + body: "*" + }; + }; +} diff --git a/rpc/factory/pb/factory.pb.go b/rpc/factory/pb/factory.pb.go new file mode 100644 index 0000000..8f6f8dd --- /dev/null +++ b/rpc/factory/pb/factory.pb.go @@ -0,0 +1,1062 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v4.25.8 +// source: factory/factory.proto + +package factory + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GroupCreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupCreateRequest) Reset() { + *x = GroupCreateRequest{} + mi := &file_factory_factory_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupCreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupCreateRequest) ProtoMessage() {} + +func (x *GroupCreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupCreateRequest.ProtoReflect.Descriptor instead. +func (*GroupCreateRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{0} +} + +func (x *GroupCreateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GroupCreateRequest) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *GroupCreateRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type GroupEditRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupEditRequest) Reset() { + *x = GroupEditRequest{} + mi := &file_factory_factory_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupEditRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupEditRequest) ProtoMessage() {} + +func (x *GroupEditRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupEditRequest.ProtoReflect.Descriptor instead. +func (*GroupEditRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{1} +} + +func (x *GroupEditRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *GroupEditRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GroupEditRequest) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *GroupEditRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type GroupItemsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupItemsRequest) Reset() { + *x = GroupItemsRequest{} + mi := &file_factory_factory_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupItemsRequest) ProtoMessage() {} + +func (x *GroupItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupItemsRequest.ProtoReflect.Descriptor instead. +func (*GroupItemsRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{2} +} + +func (x *GroupItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GroupItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GroupItemsRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *GroupItemsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GroupPasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupPasswordRequest) Reset() { + *x = GroupPasswordRequest{} + mi := &file_factory_factory_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupPasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupPasswordRequest) ProtoMessage() {} + +func (x *GroupPasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupPasswordRequest.ProtoReflect.Descriptor instead. +func (*GroupPasswordRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{3} +} + +func (x *GroupPasswordRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *GroupPasswordRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type EmptyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EmptyRequest) Reset() { + *x = EmptyRequest{} + mi := &file_factory_factory_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EmptyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRequest) ProtoMessage() {} + +func (x *EmptyRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead. +func (*EmptyRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{4} +} + +type IdRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdRequest) Reset() { + *x = IdRequest{} + mi := &file_factory_factory_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdRequest) ProtoMessage() {} + +func (x *IdRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdRequest.ProtoReflect.Descriptor instead. +func (*IdRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{5} +} + +func (x *IdRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type StatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatusRequest) Reset() { + *x = StatusRequest{} + mi := &file_factory_factory_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusRequest) ProtoMessage() {} + +func (x *StatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. +func (*StatusRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{6} +} + +func (x *StatusRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *StatusRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *StatusRequest) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type Response struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Response) Reset() { + *x = Response{} + mi := &file_factory_factory_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{7} +} + +func (x *Response) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Response) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *Response) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +type PostCreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PostCreateRequest) Reset() { + *x = PostCreateRequest{} + mi := &file_factory_factory_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PostCreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostCreateRequest) ProtoMessage() {} + +func (x *PostCreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostCreateRequest.ProtoReflect.Descriptor instead. +func (*PostCreateRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{8} +} + +func (x *PostCreateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type PostEditRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PostEditRequest) Reset() { + *x = PostEditRequest{} + mi := &file_factory_factory_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PostEditRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostEditRequest) ProtoMessage() {} + +func (x *PostEditRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostEditRequest.ProtoReflect.Descriptor instead. +func (*PostEditRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{9} +} + +func (x *PostEditRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PostEditRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type LogItemsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` + ObjType int32 `protobuf:"varint,4,opt,name=obj_type,json=objType,proto3" json:"obj_type,omitempty"` + Time []string `protobuf:"bytes,5,rep,name=time,proto3" json:"time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LogItemsRequest) Reset() { + *x = LogItemsRequest{} + mi := &file_factory_factory_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LogItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogItemsRequest) ProtoMessage() {} + +func (x *LogItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogItemsRequest.ProtoReflect.Descriptor instead. +func (*LogItemsRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{10} +} + +func (x *LogItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *LogItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *LogItemsRequest) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *LogItemsRequest) GetObjType() int32 { + if x != nil { + return x.ObjType + } + return 0 +} + +func (x *LogItemsRequest) GetTime() []string { + if x != nil { + return x.Time + } + return nil +} + +type WorkerCreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Mobile string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"` + GroupId string `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + PostId string `protobuf:"bytes,4,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkerCreateRequest) Reset() { + *x = WorkerCreateRequest{} + mi := &file_factory_factory_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkerCreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkerCreateRequest) ProtoMessage() {} + +func (x *WorkerCreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkerCreateRequest.ProtoReflect.Descriptor instead. +func (*WorkerCreateRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{11} +} + +func (x *WorkerCreateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WorkerCreateRequest) GetMobile() string { + if x != nil { + return x.Mobile + } + return "" +} + +func (x *WorkerCreateRequest) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *WorkerCreateRequest) GetPostId() string { + if x != nil { + return x.PostId + } + return "" +} + +type WorkerEditRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` + GroupId int64 `protobuf:"varint,4,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + PostId int64 `protobuf:"varint,5,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkerEditRequest) Reset() { + *x = WorkerEditRequest{} + mi := &file_factory_factory_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkerEditRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkerEditRequest) ProtoMessage() {} + +func (x *WorkerEditRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkerEditRequest.ProtoReflect.Descriptor instead. +func (*WorkerEditRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{12} +} + +func (x *WorkerEditRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *WorkerEditRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WorkerEditRequest) GetMobile() string { + if x != nil { + return x.Mobile + } + return "" +} + +func (x *WorkerEditRequest) GetGroupId() int64 { + if x != nil { + return x.GroupId + } + return 0 +} + +func (x *WorkerEditRequest) GetPostId() int64 { + if x != nil { + return x.PostId + } + return 0 +} + +type WorkerItemsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + GroupId int64 `protobuf:"varint,4,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + PostId int64 `protobuf:"varint,5,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` + Mobile string `protobuf:"bytes,6,opt,name=mobile,proto3" json:"mobile,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkerItemsRequest) Reset() { + *x = WorkerItemsRequest{} + mi := &file_factory_factory_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkerItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkerItemsRequest) ProtoMessage() {} + +func (x *WorkerItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_factory_factory_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkerItemsRequest.ProtoReflect.Descriptor instead. +func (*WorkerItemsRequest) Descriptor() ([]byte, []int) { + return file_factory_factory_proto_rawDescGZIP(), []int{13} +} + +func (x *WorkerItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *WorkerItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *WorkerItemsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WorkerItemsRequest) GetGroupId() int64 { + if x != nil { + return x.GroupId + } + return 0 +} + +func (x *WorkerItemsRequest) GetPostId() int64 { + if x != nil { + return x.PostId + } + return 0 +} + +func (x *WorkerItemsRequest) GetMobile() string { + if x != nil { + return x.Mobile + } + return "" +} + +var File_factory_factory_proto protoreflect.FileDescriptor + +const file_factory_factory_proto_rawDesc = "" + + "\n" + + "\x15factory/factory.proto\x12\afactory\x1a\x1cgoogle/api/annotations.proto\"^\n" + + "\x12GroupCreateRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\aaccount\x18\x02 \x01(\tR\aaccount\x12\x1a\n" + + "\bpassword\x18\x03 \x01(\tR\bpassword\"l\n" + + "\x10GroupEditRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x18\n" + + "\aaccount\x18\x03 \x01(\tR\aaccount\x12\x1a\n" + + "\bpassword\x18\x04 \x01(\tR\bpassword\"g\n" + + "\x11GroupItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x16\n" + + "\x06status\x18\x03 \x01(\x05R\x06status\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\"B\n" + + "\x14GroupPasswordRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\"\x0e\n" + + "\fEmptyRequest\"\x1b\n" + + "\tIdRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"O\n" + + "\rStatusRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"D\n" + + "\bResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" + + "\x03msg\x18\x02 \x01(\tR\x03msg\x12\x12\n" + + "\x04data\x18\x03 \x01(\tR\x04data\"'\n" + + "\x11PostCreateRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"5\n" + + "\x0fPostEditRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"|\n" + + "\x0fLogItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x12\n" + + "\x04type\x18\x03 \x01(\x05R\x04type\x12\x19\n" + + "\bobj_type\x18\x04 \x01(\x05R\aobjType\x12\x12\n" + + "\x04time\x18\x05 \x03(\tR\x04time\"u\n" + + "\x13WorkerCreateRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + + "\x06mobile\x18\x02 \x01(\tR\x06mobile\x12\x19\n" + + "\bgroup_id\x18\x03 \x01(\tR\agroupId\x12\x17\n" + + "\apost_id\x18\x04 \x01(\tR\x06postId\"\x83\x01\n" + + "\x11WorkerEditRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + + "\x06mobile\x18\x03 \x01(\tR\x06mobile\x12\x19\n" + + "\bgroup_id\x18\x04 \x01(\x03R\agroupId\x12\x17\n" + + "\apost_id\x18\x05 \x01(\x03R\x06postId\"\x9c\x01\n" + + "\x12WorkerItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x19\n" + + "\bgroup_id\x18\x04 \x01(\x03R\agroupId\x12\x17\n" + + "\apost_id\x18\x05 \x01(\x03R\x06postId\x12\x16\n" + + "\x06mobile\x18\x06 \x01(\tR\x06mobile2\xc1\x0e\n" + + "\aFactory\x12]\n" + + "\n" + + "GroupItems\x12\x1a.factory.GroupItemsRequest\x1a\x11.factory.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/group/items\x12S\n" + + "\tGroupInfo\x12\x12.factory.IdRequest\x1a\x11.factory.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/group/info\x12`\n" + + "\vGroupCreate\x12\x1b.factory.GroupCreateRequest\x1a\x11.factory.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/group/create\x12Z\n" + + "\tGroupEdit\x12\x19.factory.GroupEditRequest\x1a\x11.factory.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/admin/v3/group/edit\x12[\n" + + "\vGroupStatus\x12\x16.factory.StatusRequest\x1a\x11.factory.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/group/status\x12X\n" + + "\n" + + "GroupNames\x12\x15.factory.EmptyRequest\x1a\x11.factory.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/group/names\x12f\n" + + "\rGroupPassword\x12\x1d.factory.GroupPasswordRequest\x1a\x11.factory.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/admin/v3/group/password\x12V\n" + + "\tPostItems\x12\x15.factory.EmptyRequest\x1a\x11.factory.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/post/items\x12Q\n" + + "\bPostInfo\x12\x12.factory.IdRequest\x1a\x11.factory.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\x12\x13/admin/v3/post/info\x12]\n" + + "\n" + + "PostCreate\x12\x1a.factory.PostCreateRequest\x1a\x11.factory.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/admin/v3/post/create\x12W\n" + + "\bPostEdit\x12\x18.factory.PostEditRequest\x1a\x11.factory.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/admin/v3/post/edit\x12Y\n" + + "\n" + + "PostStatus\x12\x16.factory.StatusRequest\x1a\x11.factory.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/admin/v3/post/status\x12V\n" + + "\tPostNames\x12\x15.factory.EmptyRequest\x1a\x11.factory.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/post/names\x12W\n" + + "\bLogItems\x12\x18.factory.LogItemsRequest\x1a\x11.factory.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\x12\x13/admin/v3/log/items\x12c\n" + + "\fWorkerCreate\x12\x1c.factory.WorkerCreateRequest\x1a\x11.factory.Response\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/admin/v3/worker/create\x12]\n" + + "\n" + + "WorkerEdit\x12\x1a.factory.WorkerEditRequest\x1a\x11.factory.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/admin/v3/worker/edit\x12]\n" + + "\fWorkerStatus\x12\x16.factory.StatusRequest\x1a\x11.factory.Response\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/admin/v3/worker/status\x12Z\n" + + "\vWorkerNames\x12\x15.factory.EmptyRequest\x1a\x11.factory.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\x12\x16/admin/v3/worker/names\x12`\n" + + "\vWorkerItems\x12\x1b.factory.WorkerItemsRequest\x1a\x11.factory.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\x12\x16/admin/v3/worker/items\x12U\n" + + "\n" + + "WorkerInfo\x12\x12.factory.IdRequest\x1a\x11.factory.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/worker/infoB\vZ\t./factoryb\x06proto3" + +var ( + file_factory_factory_proto_rawDescOnce sync.Once + file_factory_factory_proto_rawDescData []byte +) + +func file_factory_factory_proto_rawDescGZIP() []byte { + file_factory_factory_proto_rawDescOnce.Do(func() { + file_factory_factory_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_factory_factory_proto_rawDesc), len(file_factory_factory_proto_rawDesc))) + }) + return file_factory_factory_proto_rawDescData +} + +var file_factory_factory_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_factory_factory_proto_goTypes = []any{ + (*GroupCreateRequest)(nil), // 0: factory.GroupCreateRequest + (*GroupEditRequest)(nil), // 1: factory.GroupEditRequest + (*GroupItemsRequest)(nil), // 2: factory.GroupItemsRequest + (*GroupPasswordRequest)(nil), // 3: factory.GroupPasswordRequest + (*EmptyRequest)(nil), // 4: factory.EmptyRequest + (*IdRequest)(nil), // 5: factory.IdRequest + (*StatusRequest)(nil), // 6: factory.StatusRequest + (*Response)(nil), // 7: factory.Response + (*PostCreateRequest)(nil), // 8: factory.PostCreateRequest + (*PostEditRequest)(nil), // 9: factory.PostEditRequest + (*LogItemsRequest)(nil), // 10: factory.LogItemsRequest + (*WorkerCreateRequest)(nil), // 11: factory.WorkerCreateRequest + (*WorkerEditRequest)(nil), // 12: factory.WorkerEditRequest + (*WorkerItemsRequest)(nil), // 13: factory.WorkerItemsRequest +} +var file_factory_factory_proto_depIdxs = []int32{ + 2, // 0: factory.Factory.GroupItems:input_type -> factory.GroupItemsRequest + 5, // 1: factory.Factory.GroupInfo:input_type -> factory.IdRequest + 0, // 2: factory.Factory.GroupCreate:input_type -> factory.GroupCreateRequest + 1, // 3: factory.Factory.GroupEdit:input_type -> factory.GroupEditRequest + 6, // 4: factory.Factory.GroupStatus:input_type -> factory.StatusRequest + 4, // 5: factory.Factory.GroupNames:input_type -> factory.EmptyRequest + 3, // 6: factory.Factory.GroupPassword:input_type -> factory.GroupPasswordRequest + 4, // 7: factory.Factory.PostItems:input_type -> factory.EmptyRequest + 5, // 8: factory.Factory.PostInfo:input_type -> factory.IdRequest + 8, // 9: factory.Factory.PostCreate:input_type -> factory.PostCreateRequest + 9, // 10: factory.Factory.PostEdit:input_type -> factory.PostEditRequest + 6, // 11: factory.Factory.PostStatus:input_type -> factory.StatusRequest + 4, // 12: factory.Factory.PostNames:input_type -> factory.EmptyRequest + 10, // 13: factory.Factory.LogItems:input_type -> factory.LogItemsRequest + 11, // 14: factory.Factory.WorkerCreate:input_type -> factory.WorkerCreateRequest + 12, // 15: factory.Factory.WorkerEdit:input_type -> factory.WorkerEditRequest + 6, // 16: factory.Factory.WorkerStatus:input_type -> factory.StatusRequest + 4, // 17: factory.Factory.WorkerNames:input_type -> factory.EmptyRequest + 13, // 18: factory.Factory.WorkerItems:input_type -> factory.WorkerItemsRequest + 5, // 19: factory.Factory.WorkerInfo:input_type -> factory.IdRequest + 7, // 20: factory.Factory.GroupItems:output_type -> factory.Response + 7, // 21: factory.Factory.GroupInfo:output_type -> factory.Response + 7, // 22: factory.Factory.GroupCreate:output_type -> factory.Response + 7, // 23: factory.Factory.GroupEdit:output_type -> factory.Response + 7, // 24: factory.Factory.GroupStatus:output_type -> factory.Response + 7, // 25: factory.Factory.GroupNames:output_type -> factory.Response + 7, // 26: factory.Factory.GroupPassword:output_type -> factory.Response + 7, // 27: factory.Factory.PostItems:output_type -> factory.Response + 7, // 28: factory.Factory.PostInfo:output_type -> factory.Response + 7, // 29: factory.Factory.PostCreate:output_type -> factory.Response + 7, // 30: factory.Factory.PostEdit:output_type -> factory.Response + 7, // 31: factory.Factory.PostStatus:output_type -> factory.Response + 7, // 32: factory.Factory.PostNames:output_type -> factory.Response + 7, // 33: factory.Factory.LogItems:output_type -> factory.Response + 7, // 34: factory.Factory.WorkerCreate:output_type -> factory.Response + 7, // 35: factory.Factory.WorkerEdit:output_type -> factory.Response + 7, // 36: factory.Factory.WorkerStatus:output_type -> factory.Response + 7, // 37: factory.Factory.WorkerNames:output_type -> factory.Response + 7, // 38: factory.Factory.WorkerItems:output_type -> factory.Response + 7, // 39: factory.Factory.WorkerInfo:output_type -> factory.Response + 20, // [20:40] is the sub-list for method output_type + 0, // [0:20] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_factory_factory_proto_init() } +func file_factory_factory_proto_init() { + if File_factory_factory_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_factory_factory_proto_rawDesc), len(file_factory_factory_proto_rawDesc)), + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_factory_factory_proto_goTypes, + DependencyIndexes: file_factory_factory_proto_depIdxs, + MessageInfos: file_factory_factory_proto_msgTypes, + }.Build() + File_factory_factory_proto = out.File + file_factory_factory_proto_goTypes = nil + file_factory_factory_proto_depIdxs = nil +} diff --git a/rpc/factory/pb/factory_grpc.pb.go b/rpc/factory/pb/factory_grpc.pb.go new file mode 100644 index 0000000..57a704d --- /dev/null +++ b/rpc/factory/pb/factory_grpc.pb.go @@ -0,0 +1,843 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc v4.25.8 +// source: factory/factory.proto + +package factory + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Factory_GroupItems_FullMethodName = "/factory.Factory/GroupItems" + Factory_GroupInfo_FullMethodName = "/factory.Factory/GroupInfo" + Factory_GroupCreate_FullMethodName = "/factory.Factory/GroupCreate" + Factory_GroupEdit_FullMethodName = "/factory.Factory/GroupEdit" + Factory_GroupStatus_FullMethodName = "/factory.Factory/GroupStatus" + Factory_GroupNames_FullMethodName = "/factory.Factory/GroupNames" + Factory_GroupPassword_FullMethodName = "/factory.Factory/GroupPassword" + Factory_PostItems_FullMethodName = "/factory.Factory/PostItems" + Factory_PostInfo_FullMethodName = "/factory.Factory/PostInfo" + Factory_PostCreate_FullMethodName = "/factory.Factory/PostCreate" + Factory_PostEdit_FullMethodName = "/factory.Factory/PostEdit" + Factory_PostStatus_FullMethodName = "/factory.Factory/PostStatus" + Factory_PostNames_FullMethodName = "/factory.Factory/PostNames" + Factory_LogItems_FullMethodName = "/factory.Factory/LogItems" + Factory_WorkerCreate_FullMethodName = "/factory.Factory/WorkerCreate" + Factory_WorkerEdit_FullMethodName = "/factory.Factory/WorkerEdit" + Factory_WorkerStatus_FullMethodName = "/factory.Factory/WorkerStatus" + Factory_WorkerNames_FullMethodName = "/factory.Factory/WorkerNames" + Factory_WorkerItems_FullMethodName = "/factory.Factory/WorkerItems" + Factory_WorkerInfo_FullMethodName = "/factory.Factory/WorkerInfo" +) + +// FactoryClient is the client API for Factory service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type FactoryClient interface { + GroupItems(ctx context.Context, in *GroupItemsRequest, opts ...grpc.CallOption) (*Response, error) + GroupInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) + GroupCreate(ctx context.Context, in *GroupCreateRequest, opts ...grpc.CallOption) (*Response, error) + GroupEdit(ctx context.Context, in *GroupEditRequest, opts ...grpc.CallOption) (*Response, error) + GroupStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) + GroupNames(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + GroupPassword(ctx context.Context, in *GroupPasswordRequest, opts ...grpc.CallOption) (*Response, error) + PostItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + PostInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) + PostCreate(ctx context.Context, in *PostCreateRequest, opts ...grpc.CallOption) (*Response, error) + PostEdit(ctx context.Context, in *PostEditRequest, opts ...grpc.CallOption) (*Response, error) + PostStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) + PostNames(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + LogItems(ctx context.Context, in *LogItemsRequest, opts ...grpc.CallOption) (*Response, error) + WorkerCreate(ctx context.Context, in *WorkerCreateRequest, opts ...grpc.CallOption) (*Response, error) + WorkerEdit(ctx context.Context, in *WorkerEditRequest, opts ...grpc.CallOption) (*Response, error) + WorkerStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) + WorkerNames(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + WorkerItems(ctx context.Context, in *WorkerItemsRequest, opts ...grpc.CallOption) (*Response, error) + WorkerInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) +} + +type factoryClient struct { + cc grpc.ClientConnInterface +} + +func NewFactoryClient(cc grpc.ClientConnInterface) FactoryClient { + return &factoryClient{cc} +} + +func (c *factoryClient) GroupItems(ctx context.Context, in *GroupItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_GroupItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) GroupInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_GroupInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) GroupCreate(ctx context.Context, in *GroupCreateRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_GroupCreate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) GroupEdit(ctx context.Context, in *GroupEditRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_GroupEdit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) GroupStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_GroupStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) GroupNames(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_GroupNames_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) GroupPassword(ctx context.Context, in *GroupPasswordRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_GroupPassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) PostItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_PostItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) PostInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_PostInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) PostCreate(ctx context.Context, in *PostCreateRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_PostCreate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) PostEdit(ctx context.Context, in *PostEditRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_PostEdit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) PostStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_PostStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) PostNames(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_PostNames_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) LogItems(ctx context.Context, in *LogItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_LogItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) WorkerCreate(ctx context.Context, in *WorkerCreateRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_WorkerCreate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) WorkerEdit(ctx context.Context, in *WorkerEditRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_WorkerEdit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) WorkerStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_WorkerStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) WorkerNames(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_WorkerNames_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) WorkerItems(ctx context.Context, in *WorkerItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_WorkerItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *factoryClient) WorkerInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Factory_WorkerInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// FactoryServer is the server API for Factory service. +// All implementations must embed UnimplementedFactoryServer +// for forward compatibility. +type FactoryServer interface { + GroupItems(context.Context, *GroupItemsRequest) (*Response, error) + GroupInfo(context.Context, *IdRequest) (*Response, error) + GroupCreate(context.Context, *GroupCreateRequest) (*Response, error) + GroupEdit(context.Context, *GroupEditRequest) (*Response, error) + GroupStatus(context.Context, *StatusRequest) (*Response, error) + GroupNames(context.Context, *EmptyRequest) (*Response, error) + GroupPassword(context.Context, *GroupPasswordRequest) (*Response, error) + PostItems(context.Context, *EmptyRequest) (*Response, error) + PostInfo(context.Context, *IdRequest) (*Response, error) + PostCreate(context.Context, *PostCreateRequest) (*Response, error) + PostEdit(context.Context, *PostEditRequest) (*Response, error) + PostStatus(context.Context, *StatusRequest) (*Response, error) + PostNames(context.Context, *EmptyRequest) (*Response, error) + LogItems(context.Context, *LogItemsRequest) (*Response, error) + WorkerCreate(context.Context, *WorkerCreateRequest) (*Response, error) + WorkerEdit(context.Context, *WorkerEditRequest) (*Response, error) + WorkerStatus(context.Context, *StatusRequest) (*Response, error) + WorkerNames(context.Context, *EmptyRequest) (*Response, error) + WorkerItems(context.Context, *WorkerItemsRequest) (*Response, error) + WorkerInfo(context.Context, *IdRequest) (*Response, error) + mustEmbedUnimplementedFactoryServer() +} + +// UnimplementedFactoryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedFactoryServer struct{} + +func (UnimplementedFactoryServer) GroupItems(context.Context, *GroupItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method GroupItems not implemented") +} +func (UnimplementedFactoryServer) GroupInfo(context.Context, *IdRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method GroupInfo not implemented") +} +func (UnimplementedFactoryServer) GroupCreate(context.Context, *GroupCreateRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method GroupCreate not implemented") +} +func (UnimplementedFactoryServer) GroupEdit(context.Context, *GroupEditRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method GroupEdit not implemented") +} +func (UnimplementedFactoryServer) GroupStatus(context.Context, *StatusRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method GroupStatus not implemented") +} +func (UnimplementedFactoryServer) GroupNames(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method GroupNames not implemented") +} +func (UnimplementedFactoryServer) GroupPassword(context.Context, *GroupPasswordRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method GroupPassword not implemented") +} +func (UnimplementedFactoryServer) PostItems(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method PostItems not implemented") +} +func (UnimplementedFactoryServer) PostInfo(context.Context, *IdRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method PostInfo not implemented") +} +func (UnimplementedFactoryServer) PostCreate(context.Context, *PostCreateRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method PostCreate not implemented") +} +func (UnimplementedFactoryServer) PostEdit(context.Context, *PostEditRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method PostEdit not implemented") +} +func (UnimplementedFactoryServer) PostStatus(context.Context, *StatusRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method PostStatus not implemented") +} +func (UnimplementedFactoryServer) PostNames(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method PostNames not implemented") +} +func (UnimplementedFactoryServer) LogItems(context.Context, *LogItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method LogItems not implemented") +} +func (UnimplementedFactoryServer) WorkerCreate(context.Context, *WorkerCreateRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WorkerCreate not implemented") +} +func (UnimplementedFactoryServer) WorkerEdit(context.Context, *WorkerEditRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WorkerEdit not implemented") +} +func (UnimplementedFactoryServer) WorkerStatus(context.Context, *StatusRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WorkerStatus not implemented") +} +func (UnimplementedFactoryServer) WorkerNames(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WorkerNames not implemented") +} +func (UnimplementedFactoryServer) WorkerItems(context.Context, *WorkerItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WorkerItems not implemented") +} +func (UnimplementedFactoryServer) WorkerInfo(context.Context, *IdRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WorkerInfo not implemented") +} +func (UnimplementedFactoryServer) mustEmbedUnimplementedFactoryServer() {} +func (UnimplementedFactoryServer) testEmbeddedByValue() {} + +// UnsafeFactoryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to FactoryServer will +// result in compilation errors. +type UnsafeFactoryServer interface { + mustEmbedUnimplementedFactoryServer() +} + +func RegisterFactoryServer(s grpc.ServiceRegistrar, srv FactoryServer) { + // If the following call panics, it indicates UnimplementedFactoryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Factory_ServiceDesc, srv) +} + +func _Factory_GroupItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).GroupItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_GroupItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).GroupItems(ctx, req.(*GroupItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_GroupInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).GroupInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_GroupInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).GroupInfo(ctx, req.(*IdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_GroupCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupCreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).GroupCreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_GroupCreate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).GroupCreate(ctx, req.(*GroupCreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_GroupEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupEditRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).GroupEdit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_GroupEdit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).GroupEdit(ctx, req.(*GroupEditRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_GroupStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).GroupStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_GroupStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).GroupStatus(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_GroupNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).GroupNames(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_GroupNames_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).GroupNames(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_GroupPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).GroupPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_GroupPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).GroupPassword(ctx, req.(*GroupPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_PostItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).PostItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_PostItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).PostItems(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_PostInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).PostInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_PostInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).PostInfo(ctx, req.(*IdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_PostCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PostCreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).PostCreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_PostCreate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).PostCreate(ctx, req.(*PostCreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_PostEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PostEditRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).PostEdit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_PostEdit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).PostEdit(ctx, req.(*PostEditRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_PostStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).PostStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_PostStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).PostStatus(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_PostNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).PostNames(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_PostNames_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).PostNames(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_LogItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LogItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).LogItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_LogItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).LogItems(ctx, req.(*LogItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_WorkerCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WorkerCreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).WorkerCreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_WorkerCreate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).WorkerCreate(ctx, req.(*WorkerCreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_WorkerEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WorkerEditRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).WorkerEdit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_WorkerEdit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).WorkerEdit(ctx, req.(*WorkerEditRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_WorkerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).WorkerStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_WorkerStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).WorkerStatus(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_WorkerNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).WorkerNames(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_WorkerNames_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).WorkerNames(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_WorkerItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WorkerItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).WorkerItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_WorkerItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).WorkerItems(ctx, req.(*WorkerItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Factory_WorkerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryServer).WorkerInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Factory_WorkerInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryServer).WorkerInfo(ctx, req.(*IdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Factory_ServiceDesc is the grpc.ServiceDesc for Factory service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Factory_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "factory.Factory", + HandlerType: (*FactoryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GroupItems", + Handler: _Factory_GroupItems_Handler, + }, + { + MethodName: "GroupInfo", + Handler: _Factory_GroupInfo_Handler, + }, + { + MethodName: "GroupCreate", + Handler: _Factory_GroupCreate_Handler, + }, + { + MethodName: "GroupEdit", + Handler: _Factory_GroupEdit_Handler, + }, + { + MethodName: "GroupStatus", + Handler: _Factory_GroupStatus_Handler, + }, + { + MethodName: "GroupNames", + Handler: _Factory_GroupNames_Handler, + }, + { + MethodName: "GroupPassword", + Handler: _Factory_GroupPassword_Handler, + }, + { + MethodName: "PostItems", + Handler: _Factory_PostItems_Handler, + }, + { + MethodName: "PostInfo", + Handler: _Factory_PostInfo_Handler, + }, + { + MethodName: "PostCreate", + Handler: _Factory_PostCreate_Handler, + }, + { + MethodName: "PostEdit", + Handler: _Factory_PostEdit_Handler, + }, + { + MethodName: "PostStatus", + Handler: _Factory_PostStatus_Handler, + }, + { + MethodName: "PostNames", + Handler: _Factory_PostNames_Handler, + }, + { + MethodName: "LogItems", + Handler: _Factory_LogItems_Handler, + }, + { + MethodName: "WorkerCreate", + Handler: _Factory_WorkerCreate_Handler, + }, + { + MethodName: "WorkerEdit", + Handler: _Factory_WorkerEdit_Handler, + }, + { + MethodName: "WorkerStatus", + Handler: _Factory_WorkerStatus_Handler, + }, + { + MethodName: "WorkerNames", + Handler: _Factory_WorkerNames_Handler, + }, + { + MethodName: "WorkerItems", + Handler: _Factory_WorkerItems_Handler, + }, + { + MethodName: "WorkerInfo", + Handler: _Factory_WorkerInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "factory/factory.proto", +} diff --git a/rpc/order/order.pb b/rpc/order/order.pb index e4fdeaa..c1e24fa 100644 Binary files a/rpc/order/order.pb and b/rpc/order/order.pb differ diff --git a/rpc/order/order.proto b/rpc/order/order.proto index 23dbb22..ac312b7 100644 --- a/rpc/order/order.proto +++ b/rpc/order/order.proto @@ -121,13 +121,24 @@ message UpdateOrderDeliverStatusRequest { string id = 3; } +message UpdateOrderPayStatusRequest { + string order_sn = 1; + int32 status = 2; + double pay_price = 3; + string remit_no = 4; + int32 type =5; +} +message UpdateOrderPayStatusResponse { + int64 id = 1; +} + message UpdateOrderDeliverStatusResponse { int32 num = 1; } message GetOrderInfoRequest { - int64 userId = 1; - string OrderSn = 2; + int64 user_id = 1; + string order_sn = 2; int32 type = 3; } @@ -158,6 +169,16 @@ message OrderInfoResponse { int32 verify_status = 24; int32 create_type = 25; int32 refund_status = 26; + repeated ProductItemsResponse product_items = 27; +} + +message ProductItemsResponse { + int64 id = 1; + string order_sn = 2; + int64 product_id = 3; + string product_name = 4; + double price = 5; + int32 number = 6; } service order { @@ -269,6 +290,13 @@ service order { body: "*" }; }; + rpc OrderInfo(IdRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/order/info" + body: "*" + }; + }; rpc UpdateOrderDeliverStatus(UpdateOrderDeliverStatusRequest) returns(UpdateOrderDeliverStatusResponse); rpc GetOrderInfo(GetOrderInfoRequest) returns(OrderInfoResponse); + rpc UpdateOrderDPayStatus(UpdateOrderPayStatusRequest) returns(UpdateOrderPayStatusResponse); } \ No newline at end of file diff --git a/rpc/order/pb/order.pb.go b/rpc/order/pb/order.pb.go index 687c028..c9e0fa4 100644 --- a/rpc/order/pb/order.pb.go +++ b/rpc/order/pb/order.pb.go @@ -1158,6 +1158,126 @@ func (x *UpdateOrderDeliverStatusRequest) GetId() string { return "" } +type UpdateOrderPayStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + OrderSn string `protobuf:"bytes,1,opt,name=order_sn,json=orderSn,proto3" json:"order_sn,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + PayPrice float64 `protobuf:"fixed64,3,opt,name=pay_price,json=payPrice,proto3" json:"pay_price,omitempty"` + RemitNo string `protobuf:"bytes,4,opt,name=remit_no,json=remitNo,proto3" json:"remit_no,omitempty"` + Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateOrderPayStatusRequest) Reset() { + *x = UpdateOrderPayStatusRequest{} + mi := &file_order_order_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateOrderPayStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateOrderPayStatusRequest) ProtoMessage() {} + +func (x *UpdateOrderPayStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateOrderPayStatusRequest.ProtoReflect.Descriptor instead. +func (*UpdateOrderPayStatusRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{18} +} + +func (x *UpdateOrderPayStatusRequest) GetOrderSn() string { + if x != nil { + return x.OrderSn + } + return "" +} + +func (x *UpdateOrderPayStatusRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UpdateOrderPayStatusRequest) GetPayPrice() float64 { + if x != nil { + return x.PayPrice + } + return 0 +} + +func (x *UpdateOrderPayStatusRequest) GetRemitNo() string { + if x != nil { + return x.RemitNo + } + return "" +} + +func (x *UpdateOrderPayStatusRequest) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +type UpdateOrderPayStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateOrderPayStatusResponse) Reset() { + *x = UpdateOrderPayStatusResponse{} + mi := &file_order_order_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateOrderPayStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateOrderPayStatusResponse) ProtoMessage() {} + +func (x *UpdateOrderPayStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_order_order_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateOrderPayStatusResponse.ProtoReflect.Descriptor instead. +func (*UpdateOrderPayStatusResponse) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{19} +} + +func (x *UpdateOrderPayStatusResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + type UpdateOrderDeliverStatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Num int32 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"` @@ -1167,7 +1287,7 @@ type UpdateOrderDeliverStatusResponse struct { func (x *UpdateOrderDeliverStatusResponse) Reset() { *x = UpdateOrderDeliverStatusResponse{} - mi := &file_order_order_proto_msgTypes[18] + mi := &file_order_order_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1179,7 +1299,7 @@ func (x *UpdateOrderDeliverStatusResponse) String() string { func (*UpdateOrderDeliverStatusResponse) ProtoMessage() {} func (x *UpdateOrderDeliverStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_order_order_proto_msgTypes[18] + mi := &file_order_order_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1192,7 +1312,7 @@ func (x *UpdateOrderDeliverStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateOrderDeliverStatusResponse.ProtoReflect.Descriptor instead. func (*UpdateOrderDeliverStatusResponse) Descriptor() ([]byte, []int) { - return file_order_order_proto_rawDescGZIP(), []int{18} + return file_order_order_proto_rawDescGZIP(), []int{20} } func (x *UpdateOrderDeliverStatusResponse) GetNum() int32 { @@ -1204,8 +1324,8 @@ func (x *UpdateOrderDeliverStatusResponse) GetNum() int32 { type GetOrderInfoRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` - OrderSn string `protobuf:"bytes,2,opt,name=OrderSn,proto3" json:"OrderSn,omitempty"` + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + OrderSn string `protobuf:"bytes,2,opt,name=order_sn,json=orderSn,proto3" json:"order_sn,omitempty"` Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1213,7 +1333,7 @@ type GetOrderInfoRequest struct { func (x *GetOrderInfoRequest) Reset() { *x = GetOrderInfoRequest{} - mi := &file_order_order_proto_msgTypes[19] + mi := &file_order_order_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1225,7 +1345,7 @@ func (x *GetOrderInfoRequest) String() string { func (*GetOrderInfoRequest) ProtoMessage() {} func (x *GetOrderInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_order_order_proto_msgTypes[19] + mi := &file_order_order_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1238,7 +1358,7 @@ func (x *GetOrderInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetOrderInfoRequest.ProtoReflect.Descriptor instead. func (*GetOrderInfoRequest) Descriptor() ([]byte, []int) { - return file_order_order_proto_rawDescGZIP(), []int{19} + return file_order_order_proto_rawDescGZIP(), []int{21} } func (x *GetOrderInfoRequest) GetUserId() int64 { @@ -1263,40 +1383,41 @@ func (x *GetOrderInfoRequest) GetType() int32 { } type OrderInfoResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - OrderSn string `protobuf:"bytes,2,opt,name=order_sn,json=orderSn,proto3" json:"order_sn,omitempty"` - StoreId int64 `protobuf:"varint,3,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` - StoreName string `protobuf:"bytes,4,opt,name=store_name,json=storeName,proto3" json:"store_name,omitempty"` - SaleName string `protobuf:"bytes,5,opt,name=sale_name,json=saleName,proto3" json:"sale_name,omitempty"` - SaleMobile string `protobuf:"bytes,6,opt,name=sale_mobile,json=saleMobile,proto3" json:"sale_mobile,omitempty"` - UserId int64 `protobuf:"varint,7,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - UserName string `protobuf:"bytes,8,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` - SaleId int64 `protobuf:"varint,9,opt,name=sale_id,json=saleId,proto3" json:"sale_id,omitempty"` - Mobile string `protobuf:"bytes,10,opt,name=mobile,proto3" json:"mobile,omitempty"` - Address string `protobuf:"bytes,11,opt,name=address,proto3" json:"address,omitempty"` - Addressee string `protobuf:"bytes,12,opt,name=addressee,proto3" json:"addressee,omitempty"` - DistrictIds string `protobuf:"bytes,13,opt,name=district_ids,json=districtIds,proto3" json:"district_ids,omitempty"` - TotalPrice float64 `protobuf:"fixed64,14,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` - PayPrice float64 `protobuf:"fixed64,15,opt,name=pay_price,json=payPrice,proto3" json:"pay_price,omitempty"` - PayType int32 `protobuf:"varint,16,opt,name=pay_type,json=payType,proto3" json:"pay_type,omitempty"` - DeliverStatus int32 `protobuf:"varint,17,opt,name=deliver_status,json=deliverStatus,proto3" json:"deliver_status,omitempty"` - Status int32 `protobuf:"varint,18,opt,name=status,proto3" json:"status,omitempty"` - IsSupply int32 `protobuf:"varint,19,opt,name=is_supply,json=isSupply,proto3" json:"is_supply,omitempty"` - Note string `protobuf:"bytes,20,opt,name=note,proto3" json:"note,omitempty"` - ProductIds string `protobuf:"bytes,21,opt,name=product_ids,json=productIds,proto3" json:"product_ids,omitempty"` - OutTradeNo string `protobuf:"bytes,22,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` - Type int32 `protobuf:"varint,23,opt,name=type,proto3" json:"type,omitempty"` - VerifyStatus int32 `protobuf:"varint,24,opt,name=verify_status,json=verifyStatus,proto3" json:"verify_status,omitempty"` - CreateType int32 `protobuf:"varint,25,opt,name=create_type,json=createType,proto3" json:"create_type,omitempty"` - RefundStatus int32 `protobuf:"varint,26,opt,name=refund_status,json=refundStatus,proto3" json:"refund_status,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OrderSn string `protobuf:"bytes,2,opt,name=order_sn,json=orderSn,proto3" json:"order_sn,omitempty"` + StoreId int64 `protobuf:"varint,3,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` + StoreName string `protobuf:"bytes,4,opt,name=store_name,json=storeName,proto3" json:"store_name,omitempty"` + SaleName string `protobuf:"bytes,5,opt,name=sale_name,json=saleName,proto3" json:"sale_name,omitempty"` + SaleMobile string `protobuf:"bytes,6,opt,name=sale_mobile,json=saleMobile,proto3" json:"sale_mobile,omitempty"` + UserId int64 `protobuf:"varint,7,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + UserName string `protobuf:"bytes,8,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + SaleId int64 `protobuf:"varint,9,opt,name=sale_id,json=saleId,proto3" json:"sale_id,omitempty"` + Mobile string `protobuf:"bytes,10,opt,name=mobile,proto3" json:"mobile,omitempty"` + Address string `protobuf:"bytes,11,opt,name=address,proto3" json:"address,omitempty"` + Addressee string `protobuf:"bytes,12,opt,name=addressee,proto3" json:"addressee,omitempty"` + DistrictIds string `protobuf:"bytes,13,opt,name=district_ids,json=districtIds,proto3" json:"district_ids,omitempty"` + TotalPrice float64 `protobuf:"fixed64,14,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` + PayPrice float64 `protobuf:"fixed64,15,opt,name=pay_price,json=payPrice,proto3" json:"pay_price,omitempty"` + PayType int32 `protobuf:"varint,16,opt,name=pay_type,json=payType,proto3" json:"pay_type,omitempty"` + DeliverStatus int32 `protobuf:"varint,17,opt,name=deliver_status,json=deliverStatus,proto3" json:"deliver_status,omitempty"` + Status int32 `protobuf:"varint,18,opt,name=status,proto3" json:"status,omitempty"` + IsSupply int32 `protobuf:"varint,19,opt,name=is_supply,json=isSupply,proto3" json:"is_supply,omitempty"` + Note string `protobuf:"bytes,20,opt,name=note,proto3" json:"note,omitempty"` + ProductIds string `protobuf:"bytes,21,opt,name=product_ids,json=productIds,proto3" json:"product_ids,omitempty"` + OutTradeNo string `protobuf:"bytes,22,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` + Type int32 `protobuf:"varint,23,opt,name=type,proto3" json:"type,omitempty"` + VerifyStatus int32 `protobuf:"varint,24,opt,name=verify_status,json=verifyStatus,proto3" json:"verify_status,omitempty"` + CreateType int32 `protobuf:"varint,25,opt,name=create_type,json=createType,proto3" json:"create_type,omitempty"` + RefundStatus int32 `protobuf:"varint,26,opt,name=refund_status,json=refundStatus,proto3" json:"refund_status,omitempty"` + ProductItems []*ProductItemsResponse `protobuf:"bytes,27,rep,name=product_items,json=productItems,proto3" json:"product_items,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *OrderInfoResponse) Reset() { *x = OrderInfoResponse{} - mi := &file_order_order_proto_msgTypes[20] + mi := &file_order_order_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1308,7 +1429,7 @@ func (x *OrderInfoResponse) String() string { func (*OrderInfoResponse) ProtoMessage() {} func (x *OrderInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_order_order_proto_msgTypes[20] + mi := &file_order_order_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1321,7 +1442,7 @@ func (x *OrderInfoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use OrderInfoResponse.ProtoReflect.Descriptor instead. func (*OrderInfoResponse) Descriptor() ([]byte, []int) { - return file_order_order_proto_rawDescGZIP(), []int{20} + return file_order_order_proto_rawDescGZIP(), []int{22} } func (x *OrderInfoResponse) GetId() int64 { @@ -1506,6 +1627,97 @@ func (x *OrderInfoResponse) GetRefundStatus() int32 { return 0 } +func (x *OrderInfoResponse) GetProductItems() []*ProductItemsResponse { + if x != nil { + return x.ProductItems + } + return nil +} + +type ProductItemsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + OrderSn string `protobuf:"bytes,2,opt,name=order_sn,json=orderSn,proto3" json:"order_sn,omitempty"` + ProductId int64 `protobuf:"varint,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Price float64 `protobuf:"fixed64,5,opt,name=price,proto3" json:"price,omitempty"` + Number int32 `protobuf:"varint,6,opt,name=number,proto3" json:"number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProductItemsResponse) Reset() { + *x = ProductItemsResponse{} + mi := &file_order_order_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProductItemsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProductItemsResponse) ProtoMessage() {} + +func (x *ProductItemsResponse) ProtoReflect() protoreflect.Message { + mi := &file_order_order_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProductItemsResponse.ProtoReflect.Descriptor instead. +func (*ProductItemsResponse) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{23} +} + +func (x *ProductItemsResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ProductItemsResponse) GetOrderSn() string { + if x != nil { + return x.OrderSn + } + return "" +} + +func (x *ProductItemsResponse) GetProductId() int64 { + if x != nil { + return x.ProductId + } + return 0 +} + +func (x *ProductItemsResponse) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *ProductItemsResponse) GetPrice() float64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *ProductItemsResponse) GetNumber() int32 { + if x != nil { + return x.Number + } + return 0 +} + var File_order_order_proto protoreflect.FileDescriptor const file_order_order_proto_rawDesc = "" + @@ -1595,13 +1807,21 @@ const file_order_order_proto_rawDesc = "" + "\x1fUpdateOrderDeliverStatusRequest\x12\x1b\n" + "\tsign_time\x18\x01 \x01(\tR\bsignTime\x12%\n" + "\x0edeliver_status\x18\x02 \x01(\x05R\rdeliverStatus\x12\x0e\n" + - "\x02id\x18\x03 \x01(\tR\x02id\"4\n" + + "\x02id\x18\x03 \x01(\tR\x02id\"\x9c\x01\n" + + "\x1bUpdateOrderPayStatusRequest\x12\x19\n" + + "\border_sn\x18\x01 \x01(\tR\aorderSn\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x1b\n" + + "\tpay_price\x18\x03 \x01(\x01R\bpayPrice\x12\x19\n" + + "\bremit_no\x18\x04 \x01(\tR\aremitNo\x12\x12\n" + + "\x04type\x18\x05 \x01(\x05R\x04type\".\n" + + "\x1cUpdateOrderPayStatusResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"4\n" + " UpdateOrderDeliverStatusResponse\x12\x10\n" + - "\x03num\x18\x01 \x01(\x05R\x03num\"[\n" + - "\x13GetOrderInfoRequest\x12\x16\n" + - "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x18\n" + - "\aOrderSn\x18\x02 \x01(\tR\aOrderSn\x12\x12\n" + - "\x04type\x18\x03 \x01(\x05R\x04type\"\x83\x06\n" + + "\x03num\x18\x01 \x01(\x05R\x03num\"]\n" + + "\x13GetOrderInfoRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\x03R\x06userId\x12\x19\n" + + "\border_sn\x18\x02 \x01(\tR\aorderSn\x12\x12\n" + + "\x04type\x18\x03 \x01(\x05R\x04type\"\xc5\x06\n" + "\x11OrderInfoResponse\x12\x0e\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x19\n" + "\border_sn\x18\x02 \x01(\tR\aorderSn\x12\x19\n" + @@ -1635,7 +1855,16 @@ const file_order_order_proto_rawDesc = "" + "\rverify_status\x18\x18 \x01(\x05R\fverifyStatus\x12\x1f\n" + "\vcreate_type\x18\x19 \x01(\x05R\n" + "createType\x12#\n" + - "\rrefund_status\x18\x1a \x01(\x05R\frefundStatus2\x8b\x0e\n" + + "\rrefund_status\x18\x1a \x01(\x05R\frefundStatus\x12@\n" + + "\rproduct_items\x18\x1b \x03(\v2\x1b.order.ProductItemsResponseR\fproductItems\"\xb1\x01\n" + + "\x14ProductItemsResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x19\n" + + "\border_sn\x18\x02 \x01(\tR\aorderSn\x12\x1d\n" + + "\n" + + "product_id\x18\x03 \x01(\x03R\tproductId\x12!\n" + + "\fproduct_name\x18\x04 \x01(\tR\vproductName\x12\x14\n" + + "\x05price\x18\x05 \x01(\x01R\x05price\x12\x16\n" + + "\x06number\x18\x06 \x01(\x05R\x06number2\xbe\x0f\n" + "\x05order\x12T\n" + "\x05Items\x12\x18.order.OrderItemsRequest\x1a\x0f.order.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/order/items\x12X\n" + "\tWebCreate\x12\x19.order.CreateOrderRequest\x1a\x0f.order.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/api/v3/order/create\x12b\n" + @@ -1653,9 +1882,11 @@ const file_order_order_proto_rawDesc = "" + "\x12OrderAuditingItems\x12 .order.OrderAuditingItemsRequest\x1a\x0f.order.Response\")\x82\xd3\xe4\x93\x02#:\x01*\x12\x1e/admin/v3/order/auditing/items\x12b\n" + "\rOrderAuditing\x12\x1b.order.OrderAuditingRequest\x1a\x0f.order.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/admin/v3/order/auditing\x12a\n" + "\vOrderCreate\x12\x1e.order.AdminCreateOrderRequest\x1a\x0f.order.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/order/create\x12b\n" + - "\tOrderDown\x12\x18.order.OrderItemsRequest\x1a\x1a.order.ExcelExportResponse\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/order/down\x12k\n" + + "\tOrderDown\x12\x18.order.OrderItemsRequest\x1a\x1a.order.ExcelExportResponse\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/order/down\x12O\n" + + "\tOrderInfo\x12\x10.order.IdRequest\x1a\x0f.order.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/order/info\x12k\n" + "\x18UpdateOrderDeliverStatus\x12&.order.UpdateOrderDeliverStatusRequest\x1a'.order.UpdateOrderDeliverStatusResponse\x12D\n" + - "\fGetOrderInfo\x12\x1a.order.GetOrderInfoRequest\x1a\x18.order.OrderInfoResponseB\x19Z\x17lone-services/rpc/orderb\x06proto3" + "\fGetOrderInfo\x12\x1a.order.GetOrderInfoRequest\x1a\x18.order.OrderInfoResponse\x12`\n" + + "\x15UpdateOrderDPayStatus\x12\".order.UpdateOrderPayStatusRequest\x1a#.order.UpdateOrderPayStatusResponseB\x19Z\x17lone-services/rpc/orderb\x06proto3" var ( file_order_order_proto_rawDescOnce sync.Once @@ -1669,7 +1900,7 @@ func file_order_order_proto_rawDescGZIP() []byte { return file_order_order_proto_rawDescData } -var file_order_order_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_order_order_proto_msgTypes = make([]protoimpl.MessageInfo, 24) var file_order_order_proto_goTypes = []any{ (*OrderItemsRequest)(nil), // 0: order.OrderItemsRequest (*Response)(nil), // 1: order.Response @@ -1689,54 +1920,62 @@ var file_order_order_proto_goTypes = []any{ (*OrderAuditingRequest)(nil), // 15: order.OrderAuditingRequest (*AdminCreateOrderRequest)(nil), // 16: order.AdminCreateOrderRequest (*UpdateOrderDeliverStatusRequest)(nil), // 17: order.UpdateOrderDeliverStatusRequest - (*UpdateOrderDeliverStatusResponse)(nil), // 18: order.UpdateOrderDeliverStatusResponse - (*GetOrderInfoRequest)(nil), // 19: order.GetOrderInfoRequest - (*OrderInfoResponse)(nil), // 20: order.OrderInfoResponse + (*UpdateOrderPayStatusRequest)(nil), // 18: order.UpdateOrderPayStatusRequest + (*UpdateOrderPayStatusResponse)(nil), // 19: order.UpdateOrderPayStatusResponse + (*UpdateOrderDeliverStatusResponse)(nil), // 20: order.UpdateOrderDeliverStatusResponse + (*GetOrderInfoRequest)(nil), // 21: order.GetOrderInfoRequest + (*OrderInfoResponse)(nil), // 22: order.OrderInfoResponse + (*ProductItemsResponse)(nil), // 23: order.ProductItemsResponse } var file_order_order_proto_depIdxs = []int32{ - 0, // 0: order.order.Items:input_type -> order.OrderItemsRequest - 3, // 1: order.order.WebCreate:input_type -> order.CreateOrderRequest - 4, // 2: order.order.WebCreateOne:input_type -> order.CreateOrderOneRequest - 5, // 3: order.order.WebAddressCreate:input_type -> order.EditAddressRequest - 5, // 4: order.order.WebAddressEdit:input_type -> order.EditAddressRequest - 10, // 5: order.order.WebAddressDel:input_type -> order.IdAndTypeRequest - 10, // 6: order.order.WebAddressDef:input_type -> order.IdAndTypeRequest - 10, // 7: order.order.WebAddressInfo:input_type -> order.IdAndTypeRequest - 11, // 8: order.order.WebAddressItems:input_type -> order.TypeRequest - 8, // 9: order.order.WebCart:input_type -> order.CartRequest - 7, // 10: order.order.WebCartEdit:input_type -> order.EditCartRequest - 12, // 11: order.order.AddressItem:input_type -> order.AddressItemsRequest - 13, // 12: order.order.AddressByStore:input_type -> order.AddressByStoreItemsRequest - 14, // 13: order.order.OrderAuditingItems:input_type -> order.OrderAuditingItemsRequest - 15, // 14: order.order.OrderAuditing:input_type -> order.OrderAuditingRequest - 16, // 15: order.order.OrderCreate:input_type -> order.AdminCreateOrderRequest - 0, // 16: order.order.OrderDown:input_type -> order.OrderItemsRequest - 17, // 17: order.order.UpdateOrderDeliverStatus:input_type -> order.UpdateOrderDeliverStatusRequest - 19, // 18: order.order.GetOrderInfo:input_type -> order.GetOrderInfoRequest - 1, // 19: order.order.Items:output_type -> order.Response - 1, // 20: order.order.WebCreate:output_type -> order.Response - 1, // 21: order.order.WebCreateOne:output_type -> order.Response - 1, // 22: order.order.WebAddressCreate:output_type -> order.Response - 1, // 23: order.order.WebAddressEdit:output_type -> order.Response - 1, // 24: order.order.WebAddressDel:output_type -> order.Response - 1, // 25: order.order.WebAddressDef:output_type -> order.Response - 1, // 26: order.order.WebAddressInfo:output_type -> order.Response - 1, // 27: order.order.WebAddressItems:output_type -> order.Response - 1, // 28: order.order.WebCart:output_type -> order.Response - 1, // 29: order.order.WebCartEdit:output_type -> order.Response - 1, // 30: order.order.AddressItem:output_type -> order.Response - 1, // 31: order.order.AddressByStore:output_type -> order.Response - 1, // 32: order.order.OrderAuditingItems:output_type -> order.Response - 1, // 33: order.order.OrderAuditing:output_type -> order.Response - 1, // 34: order.order.OrderCreate:output_type -> order.Response - 2, // 35: order.order.OrderDown:output_type -> order.ExcelExportResponse - 18, // 36: order.order.UpdateOrderDeliverStatus:output_type -> order.UpdateOrderDeliverStatusResponse - 20, // 37: order.order.GetOrderInfo:output_type -> order.OrderInfoResponse - 19, // [19:38] is the sub-list for method output_type - 0, // [0:19] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 23, // 0: order.OrderInfoResponse.product_items:type_name -> order.ProductItemsResponse + 0, // 1: order.order.Items:input_type -> order.OrderItemsRequest + 3, // 2: order.order.WebCreate:input_type -> order.CreateOrderRequest + 4, // 3: order.order.WebCreateOne:input_type -> order.CreateOrderOneRequest + 5, // 4: order.order.WebAddressCreate:input_type -> order.EditAddressRequest + 5, // 5: order.order.WebAddressEdit:input_type -> order.EditAddressRequest + 10, // 6: order.order.WebAddressDel:input_type -> order.IdAndTypeRequest + 10, // 7: order.order.WebAddressDef:input_type -> order.IdAndTypeRequest + 10, // 8: order.order.WebAddressInfo:input_type -> order.IdAndTypeRequest + 11, // 9: order.order.WebAddressItems:input_type -> order.TypeRequest + 8, // 10: order.order.WebCart:input_type -> order.CartRequest + 7, // 11: order.order.WebCartEdit:input_type -> order.EditCartRequest + 12, // 12: order.order.AddressItem:input_type -> order.AddressItemsRequest + 13, // 13: order.order.AddressByStore:input_type -> order.AddressByStoreItemsRequest + 14, // 14: order.order.OrderAuditingItems:input_type -> order.OrderAuditingItemsRequest + 15, // 15: order.order.OrderAuditing:input_type -> order.OrderAuditingRequest + 16, // 16: order.order.OrderCreate:input_type -> order.AdminCreateOrderRequest + 0, // 17: order.order.OrderDown:input_type -> order.OrderItemsRequest + 9, // 18: order.order.OrderInfo:input_type -> order.IdRequest + 17, // 19: order.order.UpdateOrderDeliverStatus:input_type -> order.UpdateOrderDeliverStatusRequest + 21, // 20: order.order.GetOrderInfo:input_type -> order.GetOrderInfoRequest + 18, // 21: order.order.UpdateOrderDPayStatus:input_type -> order.UpdateOrderPayStatusRequest + 1, // 22: order.order.Items:output_type -> order.Response + 1, // 23: order.order.WebCreate:output_type -> order.Response + 1, // 24: order.order.WebCreateOne:output_type -> order.Response + 1, // 25: order.order.WebAddressCreate:output_type -> order.Response + 1, // 26: order.order.WebAddressEdit:output_type -> order.Response + 1, // 27: order.order.WebAddressDel:output_type -> order.Response + 1, // 28: order.order.WebAddressDef:output_type -> order.Response + 1, // 29: order.order.WebAddressInfo:output_type -> order.Response + 1, // 30: order.order.WebAddressItems:output_type -> order.Response + 1, // 31: order.order.WebCart:output_type -> order.Response + 1, // 32: order.order.WebCartEdit:output_type -> order.Response + 1, // 33: order.order.AddressItem:output_type -> order.Response + 1, // 34: order.order.AddressByStore:output_type -> order.Response + 1, // 35: order.order.OrderAuditingItems:output_type -> order.Response + 1, // 36: order.order.OrderAuditing:output_type -> order.Response + 1, // 37: order.order.OrderCreate:output_type -> order.Response + 2, // 38: order.order.OrderDown:output_type -> order.ExcelExportResponse + 1, // 39: order.order.OrderInfo:output_type -> order.Response + 20, // 40: order.order.UpdateOrderDeliverStatus:output_type -> order.UpdateOrderDeliverStatusResponse + 22, // 41: order.order.GetOrderInfo:output_type -> order.OrderInfoResponse + 19, // 42: order.order.UpdateOrderDPayStatus:output_type -> order.UpdateOrderPayStatusResponse + 22, // [22:43] is the sub-list for method output_type + 1, // [1:22] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_order_order_proto_init() } @@ -1750,7 +1989,7 @@ func file_order_order_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_order_order_proto_rawDesc), len(file_order_order_proto_rawDesc)), NumEnums: 0, - NumMessages: 21, + NumMessages: 24, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/order/pb/order_grpc.pb.go b/rpc/order/pb/order_grpc.pb.go index f598072..de0ed70 100644 --- a/rpc/order/pb/order_grpc.pb.go +++ b/rpc/order/pb/order_grpc.pb.go @@ -36,8 +36,10 @@ const ( Order_OrderAuditing_FullMethodName = "/order.order/OrderAuditing" Order_OrderCreate_FullMethodName = "/order.order/OrderCreate" Order_OrderDown_FullMethodName = "/order.order/OrderDown" + Order_OrderInfo_FullMethodName = "/order.order/OrderInfo" Order_UpdateOrderDeliverStatus_FullMethodName = "/order.order/UpdateOrderDeliverStatus" Order_GetOrderInfo_FullMethodName = "/order.order/GetOrderInfo" + Order_UpdateOrderDPayStatus_FullMethodName = "/order.order/UpdateOrderDPayStatus" ) // OrderClient is the client API for Order service. @@ -61,8 +63,10 @@ type OrderClient interface { OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error) OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error) OrderDown(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*ExcelExportResponse, error) + OrderInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) UpdateOrderDeliverStatus(ctx context.Context, in *UpdateOrderDeliverStatusRequest, opts ...grpc.CallOption) (*UpdateOrderDeliverStatusResponse, error) GetOrderInfo(ctx context.Context, in *GetOrderInfoRequest, opts ...grpc.CallOption) (*OrderInfoResponse, error) + UpdateOrderDPayStatus(ctx context.Context, in *UpdateOrderPayStatusRequest, opts ...grpc.CallOption) (*UpdateOrderPayStatusResponse, error) } type orderClient struct { @@ -243,6 +247,16 @@ func (c *orderClient) OrderDown(ctx context.Context, in *OrderItemsRequest, opts return out, nil } +func (c *orderClient) OrderInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_OrderInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *orderClient) UpdateOrderDeliverStatus(ctx context.Context, in *UpdateOrderDeliverStatusRequest, opts ...grpc.CallOption) (*UpdateOrderDeliverStatusResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UpdateOrderDeliverStatusResponse) @@ -263,6 +277,16 @@ func (c *orderClient) GetOrderInfo(ctx context.Context, in *GetOrderInfoRequest, return out, nil } +func (c *orderClient) UpdateOrderDPayStatus(ctx context.Context, in *UpdateOrderPayStatusRequest, opts ...grpc.CallOption) (*UpdateOrderPayStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateOrderPayStatusResponse) + err := c.cc.Invoke(ctx, Order_UpdateOrderDPayStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // OrderServer is the server API for Order service. // All implementations must embed UnimplementedOrderServer // for forward compatibility. @@ -284,8 +308,10 @@ type OrderServer interface { OrderAuditing(context.Context, *OrderAuditingRequest) (*Response, error) OrderCreate(context.Context, *AdminCreateOrderRequest) (*Response, error) OrderDown(context.Context, *OrderItemsRequest) (*ExcelExportResponse, error) + OrderInfo(context.Context, *IdRequest) (*Response, error) UpdateOrderDeliverStatus(context.Context, *UpdateOrderDeliverStatusRequest) (*UpdateOrderDeliverStatusResponse, error) GetOrderInfo(context.Context, *GetOrderInfoRequest) (*OrderInfoResponse, error) + UpdateOrderDPayStatus(context.Context, *UpdateOrderPayStatusRequest) (*UpdateOrderPayStatusResponse, error) mustEmbedUnimplementedOrderServer() } @@ -347,12 +373,18 @@ func (UnimplementedOrderServer) OrderCreate(context.Context, *AdminCreateOrderRe func (UnimplementedOrderServer) OrderDown(context.Context, *OrderItemsRequest) (*ExcelExportResponse, error) { return nil, status.Error(codes.Unimplemented, "method OrderDown not implemented") } +func (UnimplementedOrderServer) OrderInfo(context.Context, *IdRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method OrderInfo not implemented") +} func (UnimplementedOrderServer) UpdateOrderDeliverStatus(context.Context, *UpdateOrderDeliverStatusRequest) (*UpdateOrderDeliverStatusResponse, error) { return nil, status.Error(codes.Unimplemented, "method UpdateOrderDeliverStatus not implemented") } func (UnimplementedOrderServer) GetOrderInfo(context.Context, *GetOrderInfoRequest) (*OrderInfoResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetOrderInfo not implemented") } +func (UnimplementedOrderServer) UpdateOrderDPayStatus(context.Context, *UpdateOrderPayStatusRequest) (*UpdateOrderPayStatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateOrderDPayStatus not implemented") +} func (UnimplementedOrderServer) mustEmbedUnimplementedOrderServer() {} func (UnimplementedOrderServer) testEmbeddedByValue() {} @@ -680,6 +712,24 @@ func _Order_OrderDown_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Order_OrderInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).OrderInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_OrderInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).OrderInfo(ctx, req.(*IdRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Order_UpdateOrderDeliverStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateOrderDeliverStatusRequest) if err := dec(in); err != nil { @@ -716,6 +766,24 @@ func _Order_GetOrderInfo_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Order_UpdateOrderDPayStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateOrderPayStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).UpdateOrderDPayStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_UpdateOrderDPayStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).UpdateOrderDPayStatus(ctx, req.(*UpdateOrderPayStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Order_ServiceDesc is the grpc.ServiceDesc for Order service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -791,6 +859,10 @@ var Order_ServiceDesc = grpc.ServiceDesc{ MethodName: "OrderDown", Handler: _Order_OrderDown_Handler, }, + { + MethodName: "OrderInfo", + Handler: _Order_OrderInfo_Handler, + }, { MethodName: "UpdateOrderDeliverStatus", Handler: _Order_UpdateOrderDeliverStatus_Handler, @@ -799,6 +871,10 @@ var Order_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetOrderInfo", Handler: _Order_GetOrderInfo_Handler, }, + { + MethodName: "UpdateOrderDPayStatus", + Handler: _Order_UpdateOrderDPayStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "order/order.proto", diff --git a/rpc/store/pb/store.pb.go b/rpc/store/pb/store.pb.go new file mode 100644 index 0000000..c9eed69 --- /dev/null +++ b/rpc/store/pb/store.pb.go @@ -0,0 +1,295 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v4.25.8 +// source: store/store.proto + +package store + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type EmptyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EmptyRequest) Reset() { + *x = EmptyRequest{} + mi := &file_store_store_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EmptyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRequest) ProtoMessage() {} + +func (x *EmptyRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_store_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead. +func (*EmptyRequest) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{0} +} + +type IdRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdRequest) Reset() { + *x = IdRequest{} + mi := &file_store_store_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdRequest) ProtoMessage() {} + +func (x *IdRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_store_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdRequest.ProtoReflect.Descriptor instead. +func (*IdRequest) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{1} +} + +func (x *IdRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type StatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatusRequest) Reset() { + *x = StatusRequest{} + mi := &file_store_store_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusRequest) ProtoMessage() {} + +func (x *StatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_store_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. +func (*StatusRequest) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{2} +} + +func (x *StatusRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *StatusRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *StatusRequest) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type Response struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Response) Reset() { + *x = Response{} + mi := &file_store_store_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_store_store_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{3} +} + +func (x *Response) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Response) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *Response) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +var File_store_store_proto protoreflect.FileDescriptor + +const file_store_store_proto_rawDesc = "" + + "\n" + + "\x11store/store.proto\x12\x05store\x1a\x1cgoogle/api/annotations.proto\"\x0e\n" + + "\fEmptyRequest\"\x1b\n" + + "\tIdRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"O\n" + + "\rStatusRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"D\n" + + "\bResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" + + "\x03msg\x18\x02 \x01(\tR\x03msg\x12\x12\n" + + "\x04data\x18\x03 \x01(\tR\x04data2[\n" + + "\x05Store\x12R\n" + + "\x06Status\x12\x14.store.StatusRequest\x1a\x0f.store.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/store/statusB\tZ\a./storeb\x06proto3" + +var ( + file_store_store_proto_rawDescOnce sync.Once + file_store_store_proto_rawDescData []byte +) + +func file_store_store_proto_rawDescGZIP() []byte { + file_store_store_proto_rawDescOnce.Do(func() { + file_store_store_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_store_store_proto_rawDesc), len(file_store_store_proto_rawDesc))) + }) + return file_store_store_proto_rawDescData +} + +var file_store_store_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_store_store_proto_goTypes = []any{ + (*EmptyRequest)(nil), // 0: store.EmptyRequest + (*IdRequest)(nil), // 1: store.IdRequest + (*StatusRequest)(nil), // 2: store.StatusRequest + (*Response)(nil), // 3: store.Response +} +var file_store_store_proto_depIdxs = []int32{ + 2, // 0: store.Store.Status:input_type -> store.StatusRequest + 3, // 1: store.Store.Status:output_type -> store.Response + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_store_store_proto_init() } +func file_store_store_proto_init() { + if File_store_store_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_store_proto_rawDesc), len(file_store_store_proto_rawDesc)), + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_store_store_proto_goTypes, + DependencyIndexes: file_store_store_proto_depIdxs, + MessageInfos: file_store_store_proto_msgTypes, + }.Build() + File_store_store_proto = out.File + file_store_store_proto_goTypes = nil + file_store_store_proto_depIdxs = nil +} diff --git a/rpc/store/pb/store_grpc.pb.go b/rpc/store/pb/store_grpc.pb.go new file mode 100644 index 0000000..7bf7cbc --- /dev/null +++ b/rpc/store/pb/store_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc v4.25.8 +// source: store/store.proto + +package store + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Store_Status_FullMethodName = "/store.Store/Status" +) + +// StoreClient is the client API for Store service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StoreClient interface { + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) +} + +type storeClient struct { + cc grpc.ClientConnInterface +} + +func NewStoreClient(cc grpc.ClientConnInterface) StoreClient { + return &storeClient{cc} +} + +func (c *storeClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Store_Status_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StoreServer is the server API for Store service. +// All implementations must embed UnimplementedStoreServer +// for forward compatibility. +type StoreServer interface { + Status(context.Context, *StatusRequest) (*Response, error) + mustEmbedUnimplementedStoreServer() +} + +// UnimplementedStoreServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStoreServer struct{} + +func (UnimplementedStoreServer) Status(context.Context, *StatusRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method Status not implemented") +} +func (UnimplementedStoreServer) mustEmbedUnimplementedStoreServer() {} +func (UnimplementedStoreServer) testEmbeddedByValue() {} + +// UnsafeStoreServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StoreServer will +// result in compilation errors. +type UnsafeStoreServer interface { + mustEmbedUnimplementedStoreServer() +} + +func RegisterStoreServer(s grpc.ServiceRegistrar, srv StoreServer) { + // If the following call panics, it indicates UnimplementedStoreServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Store_ServiceDesc, srv) +} + +func _Store_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Store_Status_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Store_ServiceDesc is the grpc.ServiceDesc for Store service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Store_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "store.Store", + HandlerType: (*StoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Status", + Handler: _Store_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "store/store.proto", +} diff --git a/rpc/store/store.pb b/rpc/store/store.pb new file mode 100644 index 0000000..6766d65 Binary files /dev/null and b/rpc/store/store.pb differ diff --git a/rpc/store/store.proto b/rpc/store/store.proto new file mode 100644 index 0000000..f02d5b5 --- /dev/null +++ b/rpc/store/store.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package store; +option go_package="./store"; +import "google/api/annotations.proto"; + +message EmptyRequest { +} + +message IdRequest { + int64 id = 1; +} + +message StatusRequest { + int64 id = 1; + int32 status = 2; + string reason = 3; +} + +message Response { + int32 code = 1; + string msg = 2; + string data = 3; +} + +service Store { + rpc Status(StatusRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/store/status" + body: "*" + }; + }; +} diff --git a/services/order/internal/dao/cart.go b/services/order/internal/dao/cart.go index 12bd3cd..47102fe 100644 --- a/services/order/internal/dao/cart.go +++ b/services/order/internal/dao/cart.go @@ -1,7 +1,7 @@ package dao -const CartTypeStore = 1 -const CartTypeSale = 2 +const CartTypeStore = 2 +const CartTypeSale = 1 const CartTypeUser = 3 type Cart struct { diff --git a/services/order/internal/logic/getOrderInfoLogic.go b/services/order/internal/logic/getOrderInfoLogic.go index 28e8cd4..13e57c2 100644 --- a/services/order/internal/logic/getOrderInfoLogic.go +++ b/services/order/internal/logic/getOrderInfoLogic.go @@ -2,17 +2,24 @@ package logic import ( "context" - + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" "lone-services/rpc/order/pb" + "lone-services/services/order/internal/dao" + "lone-services/services/order/internal/model" "lone-services/services/order/internal/svc" + "strconv" "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) type GetOrderInfoLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger + BaseLogic } func NewGetOrderInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetOrderInfoLogic { @@ -24,7 +31,84 @@ func NewGetOrderInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetO } func (l *GetOrderInfoLogic) GetOrderInfo(in *order.GetOrderInfoRequest) (*order.OrderInfoResponse, error) { - // todo: add your logic here and delete this line + var info dao.OrderInfo + modelObj := model.OrderModel{}.Init() + w := modelbase.Params{Eq: map[string]string{"order_sn": in.OrderSn}} - return &order.OrderInfoResponse{}, nil + switch in.Type { + case dao.OrderTypeSale: + w.Eq["sale_id"] = strconv.FormatInt(in.UserId, utils.NumberTen) + case dao.OrderTypePersonal: + w.Eq["user_id"] = strconv.FormatInt(in.UserId, utils.NumberTen) + case dao.OrderTypeStore: + w.Eq["store_id"] = strconv.FormatInt(in.UserId, utils.NumberTen) + default: + return nil, status.Error(codes.Internal, utils.ErrorParams.Msg) + } + + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return nil, status.Error(codes.Internal, utils.ErrorNotFund.Msg) + } + + if info.Id < utils.NumberOne { + return nil, status.Error(codes.Internal, utils.ErrorNotFund.Msg) + } + + var productItems []dao.OrderProducts + ww := modelbase.Params{ + Eq: map[string]string{"order_sn": in.OrderSn}, + } + err = model.OrderProductModel{}.Init().Items(ww, &productItems) + if err != nil { + l.Logger.Error("product err:", err) + return nil, status.Error(codes.Internal, utils.ErrorNotFund.Msg) + } + + info.ProductItems = productItems + mobile, _ := utils.DecryptPhone(info.Mobile) + info.AesMobile = info.Mobile + info.Mobile = mobile + + res := order.OrderInfoResponse{ + Id: info.Id, + OrderSn: info.OrderSn, + StoreId: int64(info.StoreId), + StoreName: info.SaleName, + SaleName: info.SaleName, + SaleMobile: info.SaleMobile, + UserId: int64(info.UserId), + UserName: info.UserName, + SaleId: int64(info.SaleId), + Mobile: info.Mobile, + Address: info.Address, + Addressee: info.Addressee, + DistrictIds: info.DistrictIds, + TotalPrice: utils.RoundFloat(info.TotalPrice), + PayPrice: utils.RoundFloat(info.PayPrice), + PayType: int32(info.PayType), + DeliverStatus: int32(info.DeliverStatus), + Status: int32(info.Status), + IsSupply: int32(info.IsSupply), + Note: info.Note, + ProductIds: info.ProductIds, + OutTradeNo: info.OutTradeNo, + Type: int32(info.Type), + VerifyStatus: int32(info.VerifyStatus), + CreateType: int32(info.CreateType), + RefundStatus: int32(info.RefundStatus), + } + for _, v := range productItems { + res.ProductItems = append(res.ProductItems, &order.ProductItemsResponse{ + Id: int64(v.Id), + ProductId: int64(v.ProductId), + ProductName: v.ProductName, + Price: utils.RoundFloat(float64(v.Price)), + Number: int32(v.Number), + OrderSn: v.OrderSn, + }) + } + + return &res, nil } diff --git a/services/order/internal/logic/itemsLogic.go b/services/order/internal/logic/itemsLogic.go index 2394fd5..b46a5e9 100644 --- a/services/order/internal/logic/itemsLogic.go +++ b/services/order/internal/logic/itemsLogic.go @@ -92,15 +92,13 @@ func (l *ItemsLogic) Items(in *order.OrderItemsRequest) (*order.Response, error) l.Logger.Error("order_sn:", v.OrderSn) ids = append(ids, v.OrderSn) } - l.Logger.Error("ids:", ids) - l.Logger.Error(len(ids), utils.NumberOne) var productItems []dao.OrderProducts ww := modelbase.Params{ In: map[string][]string{"order_sn": ids}, } err = model.OrderProductModel{}.Init().Items(ww, &productItems) if err != nil { - utils.Logger.Error("product err:", err) + l.Logger.Error("product err:", err) return l.fail(utils.ErrorNotFund) } diff --git a/services/order/internal/logic/orderInfoLogic.go b/services/order/internal/logic/orderInfoLogic.go new file mode 100644 index 0000000..73a7e87 --- /dev/null +++ b/services/order/internal/logic/orderInfoLogic.go @@ -0,0 +1,70 @@ +package logic + +import ( + "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/pkg/validate" + "lone-services/services/order/internal/dao" + "lone-services/services/order/internal/model" + "strconv" + "strings" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type OrderInfoLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewOrderInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderInfoLogic { + return &OrderInfoLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *OrderInfoLogic) OrderInfo(in *order.IdRequest) (*order.Response, error) { + var v validate.InfoValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + + var info dao.OrderInfo + modelObj := model.OrderModel{}.Init() + w := modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(in.Id))}} + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.ErrorNotFund) + } + + if info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + var productItems []dao.OrderProducts + ww := modelbase.Params{ + In: map[string][]string{"order_sn": strings.Split(info.ProductIds, utils.DecollatorComma)}, + } + err = model.OrderProductModel{}.Init().Items(ww, &productItems) + if err != nil { + l.Logger.Error("product err:", err) + return l.fail(utils.ErrorNotFund) + } + + info.ProductItems = productItems + mobile, _ := utils.DecryptPhone(info.Mobile) + info.AesMobile = info.Mobile + info.Mobile = utils.DecryptPhoneReplace(mobile) + + return l.ok(info) + +} diff --git a/services/order/internal/logic/updateOrderDPayStatusLogic.go b/services/order/internal/logic/updateOrderDPayStatusLogic.go new file mode 100644 index 0000000..cd371a7 --- /dev/null +++ b/services/order/internal/logic/updateOrderDPayStatusLogic.go @@ -0,0 +1,31 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateOrderDPayStatusLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewUpdateOrderDPayStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateOrderDPayStatusLogic { + return &UpdateOrderDPayStatusLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *UpdateOrderDPayStatusLogic) UpdateOrderDPayStatus(in *order.UpdateOrderPayStatusRequest) (*order.UpdateOrderPayStatusResponse, error) { + // todo: add your logic here and delete this line + + return &order.UpdateOrderPayStatusResponse{}, nil +} diff --git a/services/order/internal/server/orderServer.go b/services/order/internal/server/orderServer.go index a8f3d74..695e73a 100644 --- a/services/order/internal/server/orderServer.go +++ b/services/order/internal/server/orderServer.go @@ -108,6 +108,11 @@ func (s *OrderServer) OrderDown(ctx context.Context, in *order.OrderItemsRequest return l.OrderDown(in) } +func (s *OrderServer) OrderInfo(ctx context.Context, in *order.IdRequest) (*order.Response, error) { + l := logic.NewOrderInfoLogic(ctx, s.svcCtx) + return l.OrderInfo(in) +} + func (s *OrderServer) UpdateOrderDeliverStatus(ctx context.Context, in *order.UpdateOrderDeliverStatusRequest) (*order.UpdateOrderDeliverStatusResponse, error) { l := logic.NewUpdateOrderDeliverStatusLogic(ctx, s.svcCtx) return l.UpdateOrderDeliverStatus(in) @@ -117,3 +122,8 @@ func (s *OrderServer) GetOrderInfo(ctx context.Context, in *order.GetOrderInfoRe l := logic.NewGetOrderInfoLogic(ctx, s.svcCtx) return l.GetOrderInfo(in) } + +func (s *OrderServer) UpdateOrderDPayStatus(ctx context.Context, in *order.UpdateOrderPayStatusRequest) (*order.UpdateOrderPayStatusResponse, error) { + l := logic.NewUpdateOrderDPayStatusLogic(ctx, s.svcCtx) + return l.UpdateOrderDPayStatus(in) +} diff --git a/services/order/orderClient/order.go b/services/order/orderClient/order.go index 1d563bf..26078d1 100644 --- a/services/order/orderClient/order.go +++ b/services/order/orderClient/order.go @@ -31,10 +31,13 @@ type ( OrderAuditingRequest = order.OrderAuditingRequest OrderInfoResponse = order.OrderInfoResponse OrderItemsRequest = order.OrderItemsRequest + ProductItemsResponse = order.ProductItemsResponse Response = order.Response TypeRequest = order.TypeRequest UpdateOrderDeliverStatusRequest = order.UpdateOrderDeliverStatusRequest UpdateOrderDeliverStatusResponse = order.UpdateOrderDeliverStatusResponse + UpdateOrderPayStatusRequest = order.UpdateOrderPayStatusRequest + UpdateOrderPayStatusResponse = order.UpdateOrderPayStatusResponse Order interface { Items(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*Response, error) @@ -54,8 +57,10 @@ type ( OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error) OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error) OrderDown(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*ExcelExportResponse, error) + OrderInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) UpdateOrderDeliverStatus(ctx context.Context, in *UpdateOrderDeliverStatusRequest, opts ...grpc.CallOption) (*UpdateOrderDeliverStatusResponse, error) GetOrderInfo(ctx context.Context, in *GetOrderInfoRequest, opts ...grpc.CallOption) (*OrderInfoResponse, error) + UpdateOrderDPayStatus(ctx context.Context, in *UpdateOrderPayStatusRequest, opts ...grpc.CallOption) (*UpdateOrderPayStatusResponse, error) } defaultOrder struct { @@ -154,6 +159,11 @@ func (m *defaultOrder) OrderDown(ctx context.Context, in *OrderItemsRequest, opt return client.OrderDown(ctx, in, opts...) } +func (m *defaultOrder) OrderInfo(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.OrderInfo(ctx, in, opts...) +} + func (m *defaultOrder) UpdateOrderDeliverStatus(ctx context.Context, in *UpdateOrderDeliverStatusRequest, opts ...grpc.CallOption) (*UpdateOrderDeliverStatusResponse, error) { client := order.NewOrderClient(m.cli.Conn()) return client.UpdateOrderDeliverStatus(ctx, in, opts...) @@ -163,3 +173,8 @@ func (m *defaultOrder) GetOrderInfo(ctx context.Context, in *GetOrderInfoRequest client := order.NewOrderClient(m.cli.Conn()) return client.GetOrderInfo(ctx, in, opts...) } + +func (m *defaultOrder) UpdateOrderDPayStatus(ctx context.Context, in *UpdateOrderPayStatusRequest, opts ...grpc.CallOption) (*UpdateOrderPayStatusResponse, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.UpdateOrderDPayStatus(ctx, in, opts...) +}