From 174b585c8aeaf350d71ad86e7d8aed425c70d647 Mon Sep 17 00:00:00 2001 From: zzw <1464003642@qq.com> Date: Fri, 9 Oct 2026 13:21:59 +0800 Subject: [PATCH] feat: internal product items --- rpc/chore/chore.pb | Bin 16748 -> 16861 bytes rpc/chore/chore.proto | 17 +- rpc/chore/pb/chore.pb.go | 254 +++++++------ rpc/chore/pb/chore_grpc.pb.go | 38 ++ rpc/message/message.pb | Bin 14150 -> 14506 bytes rpc/message/message.proto | 9 +- rpc/message/pb/message.pb.go | 12 +- rpc/message/pb/message_grpc.pb.go | 14 +- rpc/product/pb/product.pb.go | 334 +++++++++++------- rpc/product/pb/product_grpc.pb.go | 38 ++ rpc/product/product.pb | Bin 20395 -> 20528 bytes rpc/product/product.proto | 7 + services/chore/choreclient/chore.go | 7 + services/chore/internal/dao/document.go | 13 + .../chore/internal/logic/documentLogic.go | 55 +++ services/chore/internal/logic/testLogic.go | 25 +- services/chore/internal/model/document.go | 16 + services/chore/internal/server/choreServer.go | 5 + services/chore/validator/document.go | 14 + .../message/internal/logic/apiMessageLogic.go | 67 ++-- .../internal/logic/apiMessageNumberLogic.go | 24 +- .../message/internal/server/messageServer.go | 4 +- services/message/messageclient/message.go | 6 +- services/message/validator/message.go | 8 +- .../internal/logic/internalItemsLogic.go | 71 ++++ .../product/internal/server/productServer.go | 5 + services/product/productClient/product.go | 7 + 27 files changed, 735 insertions(+), 315 deletions(-) create mode 100644 services/chore/internal/dao/document.go create mode 100644 services/chore/internal/logic/documentLogic.go create mode 100644 services/chore/internal/model/document.go create mode 100644 services/chore/validator/document.go create mode 100644 services/product/internal/logic/internalItemsLogic.go diff --git a/rpc/chore/chore.pb b/rpc/chore/chore.pb index c4213ff72fa9a17cffab8deae4364186f0966f83..c95dae130eef6d14e176f15ab5798214ff6a6522 100644 GIT binary patch delta 129 zcmaFU#CW%vaf6d7(@e?DE~Xn9l@z(SUGkGlb5rw5f>H~Ggt%BrDhpC27!?>bScAaq z&0oyqS(uu5H;Y<3vC8;xalq6I3F#$gaf6d7(+Y{rE~Xn9H%pkyu`q4n*=%9$#Jc%}gD4{a>F*1? diff --git a/rpc/chore/chore.proto b/rpc/chore/chore.proto index df8b78a..99152ca 100644 --- a/rpc/chore/chore.proto +++ b/rpc/chore/chore.proto @@ -11,15 +11,14 @@ service Chore { body: "*" }; } - // 对外:服务端直传 OSS + rpc Upload(UploadReq) returns (Response) { option (google.api.http) = { post: "/api/v3/chore/oss/upload" body: "*" }; } - // 对内:服务间直传 OSS(无 HTTP 暴露) - rpc InternalUpload(InternalUploadReq) returns (InternalUploadData); + rpc Test(TestReq) returns (Response) { option (google.api.http) = { post: "/api/v3/chore/test" @@ -88,6 +87,14 @@ service Chore { get: "/admin/v3/chore/system/items" }; } + rpc Document(DocumentReq) returns (Response) { + option (google.api.http) = { + get: "/api/v3/document" + body: "*" + }; + } + + rpc InternalUpload(InternalUploadReq) returns (InternalUploadData); rpc RegionsByIds(RegionsByIdsReq) returns (RegionsByIdsData); rpc InternalActionApplyLogCreate(InternalActionApplyLogCreateReq) returns (InternalActionApplyLogCreateData); rpc SendPassword(SendPasswordReq) returns (SendPasswordResp); @@ -125,6 +132,10 @@ message SystemEditReq { string content = 2; } +message DocumentReq { + int32 type = 1; +} + message PolicyReq { string key = 1; } diff --git a/rpc/chore/pb/chore.pb.go b/rpc/chore/pb/chore.pb.go index 1a880e4..63b8772 100644 --- a/rpc/chore/pb/chore.pb.go +++ b/rpc/chore/pb/chore.pb.go @@ -350,6 +350,50 @@ func (x *SystemEditReq) GetContent() string { return "" } +type DocumentReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DocumentReq) Reset() { + *x = DocumentReq{} + mi := &file_chore_chore_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DocumentReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocumentReq) ProtoMessage() {} + +func (x *DocumentReq) ProtoReflect() protoreflect.Message { + mi := &file_chore_chore_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 DocumentReq.ProtoReflect.Descriptor instead. +func (*DocumentReq) Descriptor() ([]byte, []int) { + return file_chore_chore_proto_rawDescGZIP(), []int{6} +} + +func (x *DocumentReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + type PolicyReq struct { state protoimpl.MessageState `protogen:"open.v1"` Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` @@ -359,7 +403,7 @@ type PolicyReq struct { func (x *PolicyReq) Reset() { *x = PolicyReq{} - mi := &file_chore_chore_proto_msgTypes[6] + mi := &file_chore_chore_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -371,7 +415,7 @@ func (x *PolicyReq) String() string { func (*PolicyReq) ProtoMessage() {} func (x *PolicyReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[6] + mi := &file_chore_chore_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -384,7 +428,7 @@ func (x *PolicyReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PolicyReq.ProtoReflect.Descriptor instead. func (*PolicyReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{6} + return file_chore_chore_proto_rawDescGZIP(), []int{7} } func (x *PolicyReq) GetKey() string { @@ -396,15 +440,15 @@ func (x *PolicyReq) GetKey() string { type UploadReq struct { state protoimpl.MessageState `protogen:"open.v1"` - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // 由 BFF 从 form-data 文件名填入 - Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // 由 BFF 从 form-data 文件内容填入 + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` + Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UploadReq) Reset() { *x = UploadReq{} - mi := &file_chore_chore_proto_msgTypes[7] + mi := &file_chore_chore_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -416,7 +460,7 @@ func (x *UploadReq) String() string { func (*UploadReq) ProtoMessage() {} func (x *UploadReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[7] + mi := &file_chore_chore_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -429,7 +473,7 @@ func (x *UploadReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadReq.ProtoReflect.Descriptor instead. func (*UploadReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{7} + return file_chore_chore_proto_rawDescGZIP(), []int{8} } func (x *UploadReq) GetFilename() string { @@ -456,7 +500,7 @@ type InternalUploadReq struct { func (x *InternalUploadReq) Reset() { *x = InternalUploadReq{} - mi := &file_chore_chore_proto_msgTypes[8] + mi := &file_chore_chore_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -468,7 +512,7 @@ func (x *InternalUploadReq) String() string { func (*InternalUploadReq) ProtoMessage() {} func (x *InternalUploadReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[8] + mi := &file_chore_chore_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -481,7 +525,7 @@ func (x *InternalUploadReq) ProtoReflect() protoreflect.Message { // Deprecated: Use InternalUploadReq.ProtoReflect.Descriptor instead. func (*InternalUploadReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{8} + return file_chore_chore_proto_rawDescGZIP(), []int{9} } func (x *InternalUploadReq) GetFilename() string { @@ -500,16 +544,16 @@ func (x *InternalUploadReq) GetContent() []byte { type InternalUploadData struct { state protoimpl.MessageState `protogen:"open.v1"` - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // 完整访问地址 - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // OSS object key - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` // CDN/自定义域名 + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *InternalUploadData) Reset() { *x = InternalUploadData{} - mi := &file_chore_chore_proto_msgTypes[9] + mi := &file_chore_chore_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -521,7 +565,7 @@ func (x *InternalUploadData) String() string { func (*InternalUploadData) ProtoMessage() {} func (x *InternalUploadData) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[9] + mi := &file_chore_chore_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -534,7 +578,7 @@ func (x *InternalUploadData) ProtoReflect() protoreflect.Message { // Deprecated: Use InternalUploadData.ProtoReflect.Descriptor instead. func (*InternalUploadData) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{9} + return file_chore_chore_proto_rawDescGZIP(), []int{10} } func (x *InternalUploadData) GetUrl() string { @@ -570,7 +614,7 @@ type TestReq struct { func (x *TestReq) Reset() { *x = TestReq{} - mi := &file_chore_chore_proto_msgTypes[10] + mi := &file_chore_chore_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -582,7 +626,7 @@ func (x *TestReq) String() string { func (*TestReq) ProtoMessage() {} func (x *TestReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[10] + mi := &file_chore_chore_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -595,7 +639,7 @@ func (x *TestReq) ProtoReflect() protoreflect.Message { // Deprecated: Use TestReq.ProtoReflect.Descriptor instead. func (*TestReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{10} + return file_chore_chore_proto_rawDescGZIP(), []int{11} } func (x *TestReq) GetId() int32 { @@ -635,7 +679,7 @@ type DecryptMobileReq struct { func (x *DecryptMobileReq) Reset() { *x = DecryptMobileReq{} - mi := &file_chore_chore_proto_msgTypes[11] + mi := &file_chore_chore_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -647,7 +691,7 @@ func (x *DecryptMobileReq) String() string { func (*DecryptMobileReq) ProtoMessage() {} func (x *DecryptMobileReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[11] + mi := &file_chore_chore_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -660,7 +704,7 @@ func (x *DecryptMobileReq) ProtoReflect() protoreflect.Message { // Deprecated: Use DecryptMobileReq.ProtoReflect.Descriptor instead. func (*DecryptMobileReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{11} + return file_chore_chore_proto_rawDescGZIP(), []int{12} } func (x *DecryptMobileReq) GetOriginMobile() string { @@ -679,7 +723,7 @@ type RegionsReq struct { func (x *RegionsReq) Reset() { *x = RegionsReq{} - mi := &file_chore_chore_proto_msgTypes[12] + mi := &file_chore_chore_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -691,7 +735,7 @@ func (x *RegionsReq) String() string { func (*RegionsReq) ProtoMessage() {} func (x *RegionsReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[12] + mi := &file_chore_chore_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -704,7 +748,7 @@ func (x *RegionsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RegionsReq.ProtoReflect.Descriptor instead. func (*RegionsReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{12} + return file_chore_chore_proto_rawDescGZIP(), []int{13} } func (x *RegionsReq) GetParentId() int32 { @@ -723,7 +767,7 @@ type RegionsByIdsReq struct { func (x *RegionsByIdsReq) Reset() { *x = RegionsByIdsReq{} - mi := &file_chore_chore_proto_msgTypes[13] + mi := &file_chore_chore_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -735,7 +779,7 @@ func (x *RegionsByIdsReq) String() string { func (*RegionsByIdsReq) ProtoMessage() {} func (x *RegionsByIdsReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[13] + mi := &file_chore_chore_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -748,7 +792,7 @@ func (x *RegionsByIdsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RegionsByIdsReq.ProtoReflect.Descriptor instead. func (*RegionsByIdsReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{13} + return file_chore_chore_proto_rawDescGZIP(), []int{14} } func (x *RegionsByIdsReq) GetIds() []int64 { @@ -768,7 +812,7 @@ type RegionItem struct { func (x *RegionItem) Reset() { *x = RegionItem{} - mi := &file_chore_chore_proto_msgTypes[14] + mi := &file_chore_chore_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -780,7 +824,7 @@ func (x *RegionItem) String() string { func (*RegionItem) ProtoMessage() {} func (x *RegionItem) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[14] + mi := &file_chore_chore_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -793,7 +837,7 @@ func (x *RegionItem) ProtoReflect() protoreflect.Message { // Deprecated: Use RegionItem.ProtoReflect.Descriptor instead. func (*RegionItem) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{14} + return file_chore_chore_proto_rawDescGZIP(), []int{15} } func (x *RegionItem) GetId() int64 { @@ -819,7 +863,7 @@ type RegionsByIdsData struct { func (x *RegionsByIdsData) Reset() { *x = RegionsByIdsData{} - mi := &file_chore_chore_proto_msgTypes[15] + mi := &file_chore_chore_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -831,7 +875,7 @@ func (x *RegionsByIdsData) String() string { func (*RegionsByIdsData) ProtoMessage() {} func (x *RegionsByIdsData) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[15] + mi := &file_chore_chore_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -844,7 +888,7 @@ func (x *RegionsByIdsData) ProtoReflect() protoreflect.Message { // Deprecated: Use RegionsByIdsData.ProtoReflect.Descriptor instead. func (*RegionsByIdsData) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{15} + return file_chore_chore_proto_rawDescGZIP(), []int{16} } func (x *RegionsByIdsData) GetItems() []*RegionItem { @@ -864,7 +908,7 @@ type SendSmsReq struct { func (x *SendSmsReq) Reset() { *x = SendSmsReq{} - mi := &file_chore_chore_proto_msgTypes[16] + mi := &file_chore_chore_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -876,7 +920,7 @@ func (x *SendSmsReq) String() string { func (*SendSmsReq) ProtoMessage() {} func (x *SendSmsReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[16] + mi := &file_chore_chore_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -889,7 +933,7 @@ func (x *SendSmsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use SendSmsReq.ProtoReflect.Descriptor instead. func (*SendSmsReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{16} + return file_chore_chore_proto_rawDescGZIP(), []int{17} } func (x *SendSmsReq) GetMobile() string { @@ -919,7 +963,7 @@ type InternalActionApplyLogCreateReq struct { func (x *InternalActionApplyLogCreateReq) Reset() { *x = InternalActionApplyLogCreateReq{} - mi := &file_chore_chore_proto_msgTypes[17] + mi := &file_chore_chore_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -931,7 +975,7 @@ func (x *InternalActionApplyLogCreateReq) String() string { func (*InternalActionApplyLogCreateReq) ProtoMessage() {} func (x *InternalActionApplyLogCreateReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[17] + mi := &file_chore_chore_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -944,7 +988,7 @@ func (x *InternalActionApplyLogCreateReq) ProtoReflect() protoreflect.Message { // Deprecated: Use InternalActionApplyLogCreateReq.ProtoReflect.Descriptor instead. func (*InternalActionApplyLogCreateReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{17} + return file_chore_chore_proto_rawDescGZIP(), []int{18} } func (x *InternalActionApplyLogCreateReq) GetAdminId() int64 { @@ -991,7 +1035,7 @@ type InternalActionApplyLogCreateData struct { func (x *InternalActionApplyLogCreateData) Reset() { *x = InternalActionApplyLogCreateData{} - mi := &file_chore_chore_proto_msgTypes[18] + mi := &file_chore_chore_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1003,7 +1047,7 @@ func (x *InternalActionApplyLogCreateData) String() string { func (*InternalActionApplyLogCreateData) ProtoMessage() {} func (x *InternalActionApplyLogCreateData) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[18] + mi := &file_chore_chore_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1016,7 +1060,7 @@ func (x *InternalActionApplyLogCreateData) ProtoReflect() protoreflect.Message { // Deprecated: Use InternalActionApplyLogCreateData.ProtoReflect.Descriptor instead. func (*InternalActionApplyLogCreateData) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{18} + return file_chore_chore_proto_rawDescGZIP(), []int{19} } func (x *InternalActionApplyLogCreateData) GetId() int64 { @@ -1039,7 +1083,7 @@ type SendPasswordReq struct { func (x *SendPasswordReq) Reset() { *x = SendPasswordReq{} - mi := &file_chore_chore_proto_msgTypes[19] + mi := &file_chore_chore_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1051,7 +1095,7 @@ func (x *SendPasswordReq) String() string { func (*SendPasswordReq) ProtoMessage() {} func (x *SendPasswordReq) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[19] + mi := &file_chore_chore_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1064,7 +1108,7 @@ func (x *SendPasswordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use SendPasswordReq.ProtoReflect.Descriptor instead. func (*SendPasswordReq) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{19} + return file_chore_chore_proto_rawDescGZIP(), []int{20} } func (x *SendPasswordReq) GetMobile() string { @@ -1111,7 +1155,7 @@ type SendPasswordResp struct { func (x *SendPasswordResp) Reset() { *x = SendPasswordResp{} - mi := &file_chore_chore_proto_msgTypes[20] + mi := &file_chore_chore_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1123,7 +1167,7 @@ func (x *SendPasswordResp) String() string { func (*SendPasswordResp) ProtoMessage() {} func (x *SendPasswordResp) ProtoReflect() protoreflect.Message { - mi := &file_chore_chore_proto_msgTypes[20] + mi := &file_chore_chore_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1136,7 +1180,7 @@ func (x *SendPasswordResp) ProtoReflect() protoreflect.Message { // Deprecated: Use SendPasswordResp.ProtoReflect.Descriptor instead. func (*SendPasswordResp) Descriptor() ([]byte, []int) { - return file_chore_chore_proto_rawDescGZIP(), []int{20} + return file_chore_chore_proto_rawDescGZIP(), []int{21} } func (x *SendPasswordResp) GetCode() int32 { @@ -1171,7 +1215,9 @@ const file_chore_chore_proto_rawDesc = "" + "\aanswers\x18\x05 \x01(\tR\aanswers\"=\n" + "\rSystemEditReq\x12\x12\n" + "\x04type\x18\x01 \x01(\x05R\x04type\x12\x18\n" + - "\acontent\x18\x02 \x01(\tR\acontent\"\x1d\n" + + "\acontent\x18\x02 \x01(\tR\acontent\"!\n" + + "\vDocumentReq\x12\x12\n" + + "\x04type\x18\x01 \x01(\x05R\x04type\"\x1d\n" + "\tPolicyReq\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\"A\n" + "\tUploadReq\x12\x1a\n" + @@ -1221,7 +1267,7 @@ const file_chore_chore_proto_rawDesc = "" + "\x02ip\x18\x04 \x01(\tR\x02ip\x12!\n" + "\fbrowser_name\x18\x05 \x01(\tR\vbrowserName\"&\n" + "\x10SendPasswordResp\x12\x12\n" + - "\x04code\x18\x01 \x01(\x05R\x04code2\xb4\f\n" + + "\x04code\x18\x01 \x01(\x05R\x04code2\x82\r\n" + "\x05Chore\x12P\n" + "\x06Policy\x12\x10.chore.PolicyReq\x1a\x0f.chore.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\x12\x18/api/v3/chore/oss/policy\x12P\n" + "\x06Upload\x12\x10.chore.UploadReq\x1a\x0f.chore.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/api/v3/chore/oss/upload\x12E\n" + @@ -1242,7 +1288,8 @@ const file_chore_chore_proto_rawDesc = "" + "\fSystemStatus\x12\x10.chore.StatusReq\x1a\x0f.chore.Response\"%\x82\xd3\xe4\x93\x02\x1f\"\x1d/admin/v3/chore/system/status\x12P\n" + "\n" + "SystemInfo\x12\f.chore.IdReq\x1a\x0f.chore.Response\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/admin/v3/chore/system/info\x12U\n" + - "\vSystemItems\x12\x0f.chore.EmptyReq\x1a\x0f.chore.Response\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/admin/v3/chore/system/items\x12?\n" + + "\vSystemItems\x12\x0f.chore.EmptyReq\x1a\x0f.chore.Response\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/admin/v3/chore/system/items\x12L\n" + + "\bDocument\x12\x12.chore.DocumentReq\x1a\x0f.chore.Response\"\x1b\x82\xd3\xe4\x93\x02\x15:\x01*\x12\x10/api/v3/document\x12?\n" + "\fRegionsByIds\x12\x16.chore.RegionsByIdsReq\x1a\x17.chore.RegionsByIdsData\x12o\n" + "\x1cInternalActionApplyLogCreate\x12&.chore.InternalActionApplyLogCreateReq\x1a'.chore.InternalActionApplyLogCreateData\x12?\n" + "\fSendPassword\x12\x16.chore.SendPasswordReq\x1a\x17.chore.SendPasswordRespB\x19Z\x17lone-services/rpc/choreb\x06proto3" @@ -1259,7 +1306,7 @@ func file_chore_chore_proto_rawDescGZIP() []byte { return file_chore_chore_proto_rawDescData } -var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_chore_chore_proto_goTypes = []any{ (*Response)(nil), // 0: chore.Response (*EmptyReq)(nil), // 1: chore.EmptyReq @@ -1267,31 +1314,32 @@ var file_chore_chore_proto_goTypes = []any{ (*StatusReq)(nil), // 3: chore.StatusReq (*EditReq)(nil), // 4: chore.EditReq (*SystemEditReq)(nil), // 5: chore.SystemEditReq - (*PolicyReq)(nil), // 6: chore.PolicyReq - (*UploadReq)(nil), // 7: chore.UploadReq - (*InternalUploadReq)(nil), // 8: chore.InternalUploadReq - (*InternalUploadData)(nil), // 9: chore.InternalUploadData - (*TestReq)(nil), // 10: chore.TestReq - (*DecryptMobileReq)(nil), // 11: chore.DecryptMobileReq - (*RegionsReq)(nil), // 12: chore.RegionsReq - (*RegionsByIdsReq)(nil), // 13: chore.RegionsByIdsReq - (*RegionItem)(nil), // 14: chore.RegionItem - (*RegionsByIdsData)(nil), // 15: chore.RegionsByIdsData - (*SendSmsReq)(nil), // 16: chore.SendSmsReq - (*InternalActionApplyLogCreateReq)(nil), // 17: chore.InternalActionApplyLogCreateReq - (*InternalActionApplyLogCreateData)(nil), // 18: chore.InternalActionApplyLogCreateData - (*SendPasswordReq)(nil), // 19: chore.SendPasswordReq - (*SendPasswordResp)(nil), // 20: chore.SendPasswordResp + (*DocumentReq)(nil), // 6: chore.DocumentReq + (*PolicyReq)(nil), // 7: chore.PolicyReq + (*UploadReq)(nil), // 8: chore.UploadReq + (*InternalUploadReq)(nil), // 9: chore.InternalUploadReq + (*InternalUploadData)(nil), // 10: chore.InternalUploadData + (*TestReq)(nil), // 11: chore.TestReq + (*DecryptMobileReq)(nil), // 12: chore.DecryptMobileReq + (*RegionsReq)(nil), // 13: chore.RegionsReq + (*RegionsByIdsReq)(nil), // 14: chore.RegionsByIdsReq + (*RegionItem)(nil), // 15: chore.RegionItem + (*RegionsByIdsData)(nil), // 16: chore.RegionsByIdsData + (*SendSmsReq)(nil), // 17: chore.SendSmsReq + (*InternalActionApplyLogCreateReq)(nil), // 18: chore.InternalActionApplyLogCreateReq + (*InternalActionApplyLogCreateData)(nil), // 19: chore.InternalActionApplyLogCreateData + (*SendPasswordReq)(nil), // 20: chore.SendPasswordReq + (*SendPasswordResp)(nil), // 21: chore.SendPasswordResp } var file_chore_chore_proto_depIdxs = []int32{ - 14, // 0: chore.RegionsByIdsData.items:type_name -> chore.RegionItem - 6, // 1: chore.Chore.Policy:input_type -> chore.PolicyReq - 7, // 2: chore.Chore.Upload:input_type -> chore.UploadReq - 8, // 3: chore.Chore.InternalUpload:input_type -> chore.InternalUploadReq - 10, // 4: chore.Chore.Test:input_type -> chore.TestReq - 11, // 5: chore.Chore.DecryptMobile:input_type -> chore.DecryptMobileReq - 12, // 6: chore.Chore.Regions:input_type -> chore.RegionsReq - 16, // 7: chore.Chore.SendSms:input_type -> chore.SendSmsReq + 15, // 0: chore.RegionsByIdsData.items:type_name -> chore.RegionItem + 7, // 1: chore.Chore.Policy:input_type -> chore.PolicyReq + 8, // 2: chore.Chore.Upload:input_type -> chore.UploadReq + 9, // 3: chore.Chore.InternalUpload:input_type -> chore.InternalUploadReq + 11, // 4: chore.Chore.Test:input_type -> chore.TestReq + 12, // 5: chore.Chore.DecryptMobile:input_type -> chore.DecryptMobileReq + 13, // 6: chore.Chore.Regions:input_type -> chore.RegionsReq + 17, // 7: chore.Chore.SendSms:input_type -> chore.SendSmsReq 1, // 8: chore.Chore.AnswerItems:input_type -> chore.EmptyReq 3, // 9: chore.Chore.AnswerStatus:input_type -> chore.StatusReq 2, // 10: chore.Chore.AnswerInfo:input_type -> chore.IdReq @@ -1301,30 +1349,32 @@ var file_chore_chore_proto_depIdxs = []int32{ 3, // 14: chore.Chore.SystemStatus:input_type -> chore.StatusReq 2, // 15: chore.Chore.SystemInfo:input_type -> chore.IdReq 1, // 16: chore.Chore.SystemItems:input_type -> chore.EmptyReq - 13, // 17: chore.Chore.RegionsByIds:input_type -> chore.RegionsByIdsReq - 17, // 18: chore.Chore.InternalActionApplyLogCreate:input_type -> chore.InternalActionApplyLogCreateReq - 19, // 19: chore.Chore.SendPassword:input_type -> chore.SendPasswordReq - 0, // 20: chore.Chore.Policy:output_type -> chore.Response - 0, // 21: chore.Chore.Upload:output_type -> chore.Response - 9, // 22: chore.Chore.InternalUpload:output_type -> chore.InternalUploadData - 0, // 23: chore.Chore.Test:output_type -> chore.Response - 0, // 24: chore.Chore.DecryptMobile:output_type -> chore.Response - 0, // 25: chore.Chore.Regions:output_type -> chore.Response - 0, // 26: chore.Chore.SendSms:output_type -> chore.Response - 0, // 27: chore.Chore.AnswerItems:output_type -> chore.Response - 0, // 28: chore.Chore.AnswerStatus:output_type -> chore.Response - 0, // 29: chore.Chore.AnswerInfo:output_type -> chore.Response - 0, // 30: chore.Chore.AnswerCreate:output_type -> chore.Response - 0, // 31: chore.Chore.AnswerEdit:output_type -> chore.Response - 0, // 32: chore.Chore.SystemEdit:output_type -> chore.Response - 0, // 33: chore.Chore.SystemStatus:output_type -> chore.Response - 0, // 34: chore.Chore.SystemInfo:output_type -> chore.Response - 0, // 35: chore.Chore.SystemItems:output_type -> chore.Response - 15, // 36: chore.Chore.RegionsByIds:output_type -> chore.RegionsByIdsData - 18, // 37: chore.Chore.InternalActionApplyLogCreate:output_type -> chore.InternalActionApplyLogCreateData - 20, // 38: chore.Chore.SendPassword:output_type -> chore.SendPasswordResp - 20, // [20:39] is the sub-list for method output_type - 1, // [1:20] is the sub-list for method input_type + 6, // 17: chore.Chore.Document:input_type -> chore.DocumentReq + 14, // 18: chore.Chore.RegionsByIds:input_type -> chore.RegionsByIdsReq + 18, // 19: chore.Chore.InternalActionApplyLogCreate:input_type -> chore.InternalActionApplyLogCreateReq + 20, // 20: chore.Chore.SendPassword:input_type -> chore.SendPasswordReq + 0, // 21: chore.Chore.Policy:output_type -> chore.Response + 0, // 22: chore.Chore.Upload:output_type -> chore.Response + 10, // 23: chore.Chore.InternalUpload:output_type -> chore.InternalUploadData + 0, // 24: chore.Chore.Test:output_type -> chore.Response + 0, // 25: chore.Chore.DecryptMobile:output_type -> chore.Response + 0, // 26: chore.Chore.Regions:output_type -> chore.Response + 0, // 27: chore.Chore.SendSms:output_type -> chore.Response + 0, // 28: chore.Chore.AnswerItems:output_type -> chore.Response + 0, // 29: chore.Chore.AnswerStatus:output_type -> chore.Response + 0, // 30: chore.Chore.AnswerInfo:output_type -> chore.Response + 0, // 31: chore.Chore.AnswerCreate:output_type -> chore.Response + 0, // 32: chore.Chore.AnswerEdit:output_type -> chore.Response + 0, // 33: chore.Chore.SystemEdit:output_type -> chore.Response + 0, // 34: chore.Chore.SystemStatus:output_type -> chore.Response + 0, // 35: chore.Chore.SystemInfo:output_type -> chore.Response + 0, // 36: chore.Chore.SystemItems:output_type -> chore.Response + 0, // 37: chore.Chore.Document:output_type -> chore.Response + 16, // 38: chore.Chore.RegionsByIds:output_type -> chore.RegionsByIdsData + 19, // 39: chore.Chore.InternalActionApplyLogCreate:output_type -> chore.InternalActionApplyLogCreateData + 21, // 40: chore.Chore.SendPassword:output_type -> chore.SendPasswordResp + 21, // [21:41] is the sub-list for method output_type + 1, // [1:21] 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 @@ -1341,7 +1391,7 @@ func file_chore_chore_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_chore_chore_proto_rawDesc), len(file_chore_chore_proto_rawDesc)), NumEnums: 0, - NumMessages: 21, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/chore/pb/chore_grpc.pb.go b/rpc/chore/pb/chore_grpc.pb.go index 84ed14f..3f529db 100644 --- a/rpc/chore/pb/chore_grpc.pb.go +++ b/rpc/chore/pb/chore_grpc.pb.go @@ -35,6 +35,7 @@ const ( Chore_SystemStatus_FullMethodName = "/chore.Chore/SystemStatus" Chore_SystemInfo_FullMethodName = "/chore.Chore/SystemInfo" Chore_SystemItems_FullMethodName = "/chore.Chore/SystemItems" + Chore_Document_FullMethodName = "/chore.Chore/Document" Chore_RegionsByIds_FullMethodName = "/chore.Chore/RegionsByIds" Chore_InternalActionApplyLogCreate_FullMethodName = "/chore.Chore/InternalActionApplyLogCreate" Chore_SendPassword_FullMethodName = "/chore.Chore/SendPassword" @@ -62,6 +63,7 @@ type ChoreClient interface { SystemStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Response, error) SystemInfo(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*Response, error) SystemItems(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error) + Document(ctx context.Context, in *DocumentReq, opts ...grpc.CallOption) (*Response, error) RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error) InternalActionApplyLogCreate(ctx context.Context, in *InternalActionApplyLogCreateReq, opts ...grpc.CallOption) (*InternalActionApplyLogCreateData, error) SendPassword(ctx context.Context, in *SendPasswordReq, opts ...grpc.CallOption) (*SendPasswordResp, error) @@ -235,6 +237,16 @@ func (c *choreClient) SystemItems(ctx context.Context, in *EmptyReq, opts ...grp return out, nil } +func (c *choreClient) Document(ctx context.Context, in *DocumentReq, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Chore_Document_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *choreClient) RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(RegionsByIdsData) @@ -287,6 +299,7 @@ type ChoreServer interface { SystemStatus(context.Context, *StatusReq) (*Response, error) SystemInfo(context.Context, *IdReq) (*Response, error) SystemItems(context.Context, *EmptyReq) (*Response, error) + Document(context.Context, *DocumentReq) (*Response, error) RegionsByIds(context.Context, *RegionsByIdsReq) (*RegionsByIdsData, error) InternalActionApplyLogCreate(context.Context, *InternalActionApplyLogCreateReq) (*InternalActionApplyLogCreateData, error) SendPassword(context.Context, *SendPasswordReq) (*SendPasswordResp, error) @@ -348,6 +361,9 @@ func (UnimplementedChoreServer) SystemInfo(context.Context, *IdReq) (*Response, func (UnimplementedChoreServer) SystemItems(context.Context, *EmptyReq) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method SystemItems not implemented") } +func (UnimplementedChoreServer) Document(context.Context, *DocumentReq) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method Document not implemented") +} func (UnimplementedChoreServer) RegionsByIds(context.Context, *RegionsByIdsReq) (*RegionsByIdsData, error) { return nil, status.Error(codes.Unimplemented, "method RegionsByIds not implemented") } @@ -666,6 +682,24 @@ func _Chore_SystemItems_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Chore_Document_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DocumentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChoreServer).Document(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Chore_Document_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChoreServer).Document(ctx, req.(*DocumentReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Chore_RegionsByIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RegionsByIdsReq) if err := dec(in); err != nil { @@ -791,6 +825,10 @@ var Chore_ServiceDesc = grpc.ServiceDesc{ MethodName: "SystemItems", Handler: _Chore_SystemItems_Handler, }, + { + MethodName: "Document", + Handler: _Chore_Document_Handler, + }, { MethodName: "RegionsByIds", Handler: _Chore_RegionsByIds_Handler, diff --git a/rpc/message/message.pb b/rpc/message/message.pb index 7b20ecf7b0448ca6b679316d5854cc1b36510ddd..620f5a17335d764fcc4633307fa401fdc1dac802 100644 GIT binary patch delta 645 zcmX?>x2kZ%S|+CFNt4$znJ}GVocx5zufCe2;mxW4i~@}yQYu#{8^RYd(Mu{#(@RM$ zPADR%#HVHEq{btJTrRZ6P#M&3RA8$ zgLShLv#JWyTJFi2>d|bQ7@0X_TiH;q-hdJ`nAm50_NtX!8@|0tprr<(K3e zN(q73d;wq%Ox5NJ9d0J3dCZ$z^)wjkOHm>!T__bAQQ&C75>dtZrA5i9@yYoqsqvY4 zY57R8q=hAxg2Bq2fvP=$iV;zCfr(4dJvA?N^I?4j7RG0rpBP_dWPCk&muV(%EEkt! vL8fnNadBdL>f{M#W)f0Om!C{#0*1DJVnL>UnX!H@RI<`6jWKWX1G6*$`S0RX delta 298 zcmZ2gcr0(jS|+BBgvslfOc6>}bLu~%KqH9Uyq;M@g=sn0-b4LSs?zKD@ih{Zp^)lcF%J4nfk$#*oeC;Mv3u|jxR zni)VHKsA2;ey(8kK;2=kL7r}ra2+2tlVuh$iU{%hxca$=c*F+;xw?5qfQ^S3QlJ$# z`HGf0#K_IRw4O7vvvIs&7wGoeoTtmp#I%)ZbG5z(BbpB+4K-O9A8vLwy~@b=Y_g message.ItemsRequest - 2, // 1: message.Message.ApiMessage:input_type -> message.ItemsRequest + 4, // 1: message.Message.ApiMessage:input_type -> message.ApiMessageNumberRequest 4, // 2: message.Message.ApiMessageNumber:input_type -> message.ApiMessageNumberRequest 3, // 3: message.Message.MessageAdd:input_type -> message.AddRequest 0, // 4: message.Message.AdminMessage:output_type -> message.Response diff --git a/rpc/message/pb/message_grpc.pb.go b/rpc/message/pb/message_grpc.pb.go index cf27b7f..28ac3bf 100644 --- a/rpc/message/pb/message_grpc.pb.go +++ b/rpc/message/pb/message_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.2 -// - protoc v4.25.8 +// - protoc v3.19.4 // source: message/message.proto package message @@ -30,7 +30,7 @@ const ( // 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 MessageClient interface { AdminMessage(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) - ApiMessage(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) + ApiMessage(ctx context.Context, in *ApiMessageNumberRequest, opts ...grpc.CallOption) (*Response, error) ApiMessageNumber(ctx context.Context, in *ApiMessageNumberRequest, opts ...grpc.CallOption) (*Response, error) MessageAdd(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) } @@ -53,7 +53,7 @@ func (c *messageClient) AdminMessage(ctx context.Context, in *ItemsRequest, opts return out, nil } -func (c *messageClient) ApiMessage(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) { +func (c *messageClient) ApiMessage(ctx context.Context, in *ApiMessageNumberRequest, opts ...grpc.CallOption) (*Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Response) err := c.cc.Invoke(ctx, Message_ApiMessage_FullMethodName, in, out, cOpts...) @@ -88,7 +88,7 @@ func (c *messageClient) MessageAdd(ctx context.Context, in *AddRequest, opts ... // for forward compatibility. type MessageServer interface { AdminMessage(context.Context, *ItemsRequest) (*Response, error) - ApiMessage(context.Context, *ItemsRequest) (*Response, error) + ApiMessage(context.Context, *ApiMessageNumberRequest) (*Response, error) ApiMessageNumber(context.Context, *ApiMessageNumberRequest) (*Response, error) MessageAdd(context.Context, *AddRequest) (*AddResponse, error) mustEmbedUnimplementedMessageServer() @@ -104,7 +104,7 @@ type UnimplementedMessageServer struct{} func (UnimplementedMessageServer) AdminMessage(context.Context, *ItemsRequest) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method AdminMessage not implemented") } -func (UnimplementedMessageServer) ApiMessage(context.Context, *ItemsRequest) (*Response, error) { +func (UnimplementedMessageServer) ApiMessage(context.Context, *ApiMessageNumberRequest) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method ApiMessage not implemented") } func (UnimplementedMessageServer) ApiMessageNumber(context.Context, *ApiMessageNumberRequest) (*Response, error) { @@ -153,7 +153,7 @@ func _Message_AdminMessage_Handler(srv interface{}, ctx context.Context, dec fun } func _Message_ApiMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ItemsRequest) + in := new(ApiMessageNumberRequest) if err := dec(in); err != nil { return nil, err } @@ -165,7 +165,7 @@ func _Message_ApiMessage_Handler(srv interface{}, ctx context.Context, dec func( FullMethod: Message_ApiMessage_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MessageServer).ApiMessage(ctx, req.(*ItemsRequest)) + return srv.(MessageServer).ApiMessage(ctx, req.(*ApiMessageNumberRequest)) } return interceptor(ctx, in, info, handler) } diff --git a/rpc/product/pb/product.pb.go b/rpc/product/pb/product.pb.go index ce3a6eb..0a9e1ee 100644 --- a/rpc/product/pb/product.pb.go +++ b/rpc/product/pb/product.pb.go @@ -563,6 +563,59 @@ func (x *ItemsReq) GetPageSize() uint32 { return 0 } +// 内部产品列表;status、type 为空则不加对应筛选条件 +type InternalItemsReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status []uint32 `protobuf:"varint,1,rep,packed,name=status,proto3" json:"status,omitempty"` + Type []uint32 `protobuf:"varint,2,rep,packed,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InternalItemsReq) Reset() { + *x = InternalItemsReq{} + mi := &file_product_product_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InternalItemsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InternalItemsReq) ProtoMessage() {} + +func (x *InternalItemsReq) ProtoReflect() protoreflect.Message { + mi := &file_product_product_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 InternalItemsReq.ProtoReflect.Descriptor instead. +func (*InternalItemsReq) Descriptor() ([]byte, []int) { + return file_product_product_proto_rawDescGZIP(), []int{7} +} + +func (x *InternalItemsReq) GetStatus() []uint32 { + if x != nil { + return x.Status + } + return nil +} + +func (x *InternalItemsReq) GetType() []uint32 { + if x != nil { + return x.Type + } + return nil +} + type NamesReq struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -571,7 +624,7 @@ type NamesReq struct { func (x *NamesReq) Reset() { *x = NamesReq{} - mi := &file_product_product_proto_msgTypes[7] + mi := &file_product_product_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -583,7 +636,7 @@ func (x *NamesReq) String() string { func (*NamesReq) ProtoMessage() {} func (x *NamesReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[7] + mi := &file_product_product_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -596,7 +649,7 @@ func (x *NamesReq) ProtoReflect() protoreflect.Message { // Deprecated: Use NamesReq.ProtoReflect.Descriptor instead. func (*NamesReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{7} + return file_product_product_proto_rawDescGZIP(), []int{8} } type StatusReq struct { @@ -610,7 +663,7 @@ type StatusReq struct { func (x *StatusReq) Reset() { *x = StatusReq{} - mi := &file_product_product_proto_msgTypes[8] + mi := &file_product_product_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -622,7 +675,7 @@ func (x *StatusReq) String() string { func (*StatusReq) ProtoMessage() {} func (x *StatusReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[8] + mi := &file_product_product_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -635,7 +688,7 @@ func (x *StatusReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusReq.ProtoReflect.Descriptor instead. func (*StatusReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{8} + return file_product_product_proto_rawDescGZIP(), []int{9} } func (x *StatusReq) GetId() int64 { @@ -669,7 +722,7 @@ type SortReq struct { func (x *SortReq) Reset() { *x = SortReq{} - mi := &file_product_product_proto_msgTypes[9] + mi := &file_product_product_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -681,7 +734,7 @@ func (x *SortReq) String() string { func (*SortReq) ProtoMessage() {} func (x *SortReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[9] + mi := &file_product_product_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -694,7 +747,7 @@ func (x *SortReq) ProtoReflect() protoreflect.Message { // Deprecated: Use SortReq.ProtoReflect.Descriptor instead. func (*SortReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{9} + return file_product_product_proto_rawDescGZIP(), []int{10} } func (x *SortReq) GetId() int64 { @@ -723,7 +776,7 @@ type VerifyReq struct { func (x *VerifyReq) Reset() { *x = VerifyReq{} - mi := &file_product_product_proto_msgTypes[10] + mi := &file_product_product_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -735,7 +788,7 @@ func (x *VerifyReq) String() string { func (*VerifyReq) ProtoMessage() {} func (x *VerifyReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[10] + mi := &file_product_product_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -748,7 +801,7 @@ func (x *VerifyReq) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyReq.ProtoReflect.Descriptor instead. func (*VerifyReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{10} + return file_product_product_proto_rawDescGZIP(), []int{11} } func (x *VerifyReq) GetStatus() uint32 { @@ -784,7 +837,7 @@ type VerifyStatusReq struct { func (x *VerifyStatusReq) Reset() { *x = VerifyStatusReq{} - mi := &file_product_product_proto_msgTypes[11] + mi := &file_product_product_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -796,7 +849,7 @@ func (x *VerifyStatusReq) String() string { func (*VerifyStatusReq) ProtoMessage() {} func (x *VerifyStatusReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[11] + mi := &file_product_product_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -809,7 +862,7 @@ func (x *VerifyStatusReq) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyStatusReq.ProtoReflect.Descriptor instead. func (*VerifyStatusReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{11} + return file_product_product_proto_rawDescGZIP(), []int{12} } func (x *VerifyStatusReq) GetId() int64 { @@ -843,7 +896,7 @@ type EditApplyReq struct { func (x *EditApplyReq) Reset() { *x = EditApplyReq{} - mi := &file_product_product_proto_msgTypes[12] + mi := &file_product_product_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -855,7 +908,7 @@ func (x *EditApplyReq) String() string { func (*EditApplyReq) ProtoMessage() {} func (x *EditApplyReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[12] + mi := &file_product_product_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -868,7 +921,7 @@ func (x *EditApplyReq) ProtoReflect() protoreflect.Message { // Deprecated: Use EditApplyReq.ProtoReflect.Descriptor instead. func (*EditApplyReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{12} + return file_product_product_proto_rawDescGZIP(), []int{13} } func (x *EditApplyReq) GetId() int64 { @@ -895,7 +948,7 @@ type EditApplyPassReq struct { func (x *EditApplyPassReq) Reset() { *x = EditApplyPassReq{} - mi := &file_product_product_proto_msgTypes[13] + mi := &file_product_product_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -907,7 +960,7 @@ func (x *EditApplyPassReq) String() string { func (*EditApplyPassReq) ProtoMessage() {} func (x *EditApplyPassReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[13] + mi := &file_product_product_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -920,7 +973,7 @@ func (x *EditApplyPassReq) ProtoReflect() protoreflect.Message { // Deprecated: Use EditApplyPassReq.ProtoReflect.Descriptor instead. func (*EditApplyPassReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{13} + return file_product_product_proto_rawDescGZIP(), []int{14} } func (x *EditApplyPassReq) GetId() int64 { @@ -952,7 +1005,7 @@ type EditBaseReq struct { func (x *EditBaseReq) Reset() { *x = EditBaseReq{} - mi := &file_product_product_proto_msgTypes[14] + mi := &file_product_product_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -964,7 +1017,7 @@ func (x *EditBaseReq) String() string { func (*EditBaseReq) ProtoMessage() {} func (x *EditBaseReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[14] + mi := &file_product_product_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -977,7 +1030,7 @@ func (x *EditBaseReq) ProtoReflect() protoreflect.Message { // Deprecated: Use EditBaseReq.ProtoReflect.Descriptor instead. func (*EditBaseReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{14} + return file_product_product_proto_rawDescGZIP(), []int{15} } func (x *EditBaseReq) GetId() int64 { @@ -1097,7 +1150,7 @@ type EditSusceptibleReq struct { func (x *EditSusceptibleReq) Reset() { *x = EditSusceptibleReq{} - mi := &file_product_product_proto_msgTypes[15] + mi := &file_product_product_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1109,7 +1162,7 @@ func (x *EditSusceptibleReq) String() string { func (*EditSusceptibleReq) ProtoMessage() {} func (x *EditSusceptibleReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[15] + mi := &file_product_product_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1122,7 +1175,7 @@ func (x *EditSusceptibleReq) ProtoReflect() protoreflect.Message { // Deprecated: Use EditSusceptibleReq.ProtoReflect.Descriptor instead. func (*EditSusceptibleReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{15} + return file_product_product_proto_rawDescGZIP(), []int{16} } func (x *EditSusceptibleReq) GetId() int64 { @@ -1214,7 +1267,7 @@ type NumberReq struct { func (x *NumberReq) Reset() { *x = NumberReq{} - mi := &file_product_product_proto_msgTypes[16] + mi := &file_product_product_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1226,7 +1279,7 @@ func (x *NumberReq) String() string { func (*NumberReq) ProtoMessage() {} func (x *NumberReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[16] + mi := &file_product_product_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1239,7 +1292,7 @@ func (x *NumberReq) ProtoReflect() protoreflect.Message { // Deprecated: Use NumberReq.ProtoReflect.Descriptor instead. func (*NumberReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{16} + return file_product_product_proto_rawDescGZIP(), []int{17} } func (x *NumberReq) GetId() int64 { @@ -1273,7 +1326,7 @@ type NumberItem struct { func (x *NumberItem) Reset() { *x = NumberItem{} - mi := &file_product_product_proto_msgTypes[17] + mi := &file_product_product_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1285,7 +1338,7 @@ func (x *NumberItem) String() string { func (*NumberItem) ProtoMessage() {} func (x *NumberItem) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[17] + mi := &file_product_product_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1298,7 +1351,7 @@ func (x *NumberItem) ProtoReflect() protoreflect.Message { // Deprecated: Use NumberItem.ProtoReflect.Descriptor instead. func (*NumberItem) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{17} + return file_product_product_proto_rawDescGZIP(), []int{18} } func (x *NumberItem) GetId() int64 { @@ -1326,7 +1379,7 @@ type NumberItemsReq struct { func (x *NumberItemsReq) Reset() { *x = NumberItemsReq{} - mi := &file_product_product_proto_msgTypes[18] + mi := &file_product_product_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1338,7 +1391,7 @@ func (x *NumberItemsReq) String() string { func (*NumberItemsReq) ProtoMessage() {} func (x *NumberItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[18] + mi := &file_product_product_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1351,7 +1404,7 @@ func (x *NumberItemsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use NumberItemsReq.ProtoReflect.Descriptor instead. func (*NumberItemsReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{18} + return file_product_product_proto_rawDescGZIP(), []int{19} } func (x *NumberItemsReq) GetType() uint32 { @@ -1378,7 +1431,7 @@ type NumberAddReq struct { func (x *NumberAddReq) Reset() { *x = NumberAddReq{} - mi := &file_product_product_proto_msgTypes[19] + mi := &file_product_product_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1390,7 +1443,7 @@ func (x *NumberAddReq) String() string { func (*NumberAddReq) ProtoMessage() {} func (x *NumberAddReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[19] + mi := &file_product_product_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1403,7 +1456,7 @@ func (x *NumberAddReq) ProtoReflect() protoreflect.Message { // Deprecated: Use NumberAddReq.ProtoReflect.Descriptor instead. func (*NumberAddReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{19} + return file_product_product_proto_rawDescGZIP(), []int{20} } func (x *NumberAddReq) GetId() int64 { @@ -1429,7 +1482,7 @@ type ApiItemsReq struct { func (x *ApiItemsReq) Reset() { *x = ApiItemsReq{} - mi := &file_product_product_proto_msgTypes[20] + mi := &file_product_product_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1441,7 +1494,7 @@ func (x *ApiItemsReq) String() string { func (*ApiItemsReq) ProtoMessage() {} func (x *ApiItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[20] + mi := &file_product_product_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1454,7 +1507,7 @@ func (x *ApiItemsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ApiItemsReq.ProtoReflect.Descriptor instead. func (*ApiItemsReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{20} + return file_product_product_proto_rawDescGZIP(), []int{21} } func (x *ApiItemsReq) GetName() string { @@ -1473,7 +1526,7 @@ type ApiInfoReq struct { func (x *ApiInfoReq) Reset() { *x = ApiInfoReq{} - mi := &file_product_product_proto_msgTypes[21] + mi := &file_product_product_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1485,7 +1538,7 @@ func (x *ApiInfoReq) String() string { func (*ApiInfoReq) ProtoMessage() {} func (x *ApiInfoReq) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[21] + mi := &file_product_product_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1498,7 +1551,7 @@ func (x *ApiInfoReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ApiInfoReq.ProtoReflect.Descriptor instead. func (*ApiInfoReq) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{21} + return file_product_product_proto_rawDescGZIP(), []int{22} } func (x *ApiInfoReq) GetId() int64 { @@ -1535,7 +1588,7 @@ type ApiItem struct { func (x *ApiItem) Reset() { *x = ApiItem{} - mi := &file_product_product_proto_msgTypes[22] + mi := &file_product_product_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1547,7 +1600,7 @@ func (x *ApiItem) String() string { func (*ApiItem) ProtoMessage() {} func (x *ApiItem) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[22] + mi := &file_product_product_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1560,7 +1613,7 @@ func (x *ApiItem) ProtoReflect() protoreflect.Message { // Deprecated: Use ApiItem.ProtoReflect.Descriptor instead. func (*ApiItem) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{22} + return file_product_product_proto_rawDescGZIP(), []int{23} } func (x *ApiItem) GetId() int64 { @@ -1699,7 +1752,7 @@ type ItemsData struct { func (x *ItemsData) Reset() { *x = ItemsData{} - mi := &file_product_product_proto_msgTypes[23] + mi := &file_product_product_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1711,7 +1764,7 @@ func (x *ItemsData) String() string { func (*ItemsData) ProtoMessage() {} func (x *ItemsData) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[23] + mi := &file_product_product_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1724,7 +1777,7 @@ func (x *ItemsData) ProtoReflect() protoreflect.Message { // Deprecated: Use ItemsData.ProtoReflect.Descriptor instead. func (*ItemsData) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{23} + return file_product_product_proto_rawDescGZIP(), []int{24} } func (x *ItemsData) GetCount() int64 { @@ -1751,7 +1804,7 @@ type VerifyItemsData struct { func (x *VerifyItemsData) Reset() { *x = VerifyItemsData{} - mi := &file_product_product_proto_msgTypes[24] + mi := &file_product_product_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1763,7 +1816,7 @@ func (x *VerifyItemsData) String() string { func (*VerifyItemsData) ProtoMessage() {} func (x *VerifyItemsData) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[24] + mi := &file_product_product_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1776,7 +1829,7 @@ func (x *VerifyItemsData) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyItemsData.ProtoReflect.Descriptor instead. func (*VerifyItemsData) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{24} + return file_product_product_proto_rawDescGZIP(), []int{25} } func (x *VerifyItemsData) GetCount() int64 { @@ -1813,7 +1866,7 @@ type VerifyParams struct { func (x *VerifyParams) Reset() { *x = VerifyParams{} - mi := &file_product_product_proto_msgTypes[25] + mi := &file_product_product_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1825,7 +1878,7 @@ func (x *VerifyParams) String() string { func (*VerifyParams) ProtoMessage() {} func (x *VerifyParams) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[25] + mi := &file_product_product_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1838,7 +1891,7 @@ func (x *VerifyParams) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyParams.ProtoReflect.Descriptor instead. func (*VerifyParams) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{25} + return file_product_product_proto_rawDescGZIP(), []int{26} } func (x *VerifyParams) GetId() int64 { @@ -1937,7 +1990,7 @@ type VerifyItem struct { func (x *VerifyItem) Reset() { *x = VerifyItem{} - mi := &file_product_product_proto_msgTypes[26] + mi := &file_product_product_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1949,7 +2002,7 @@ func (x *VerifyItem) String() string { func (*VerifyItem) ProtoMessage() {} func (x *VerifyItem) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[26] + mi := &file_product_product_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1962,7 +2015,7 @@ func (x *VerifyItem) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyItem.ProtoReflect.Descriptor instead. func (*VerifyItem) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{26} + return file_product_product_proto_rawDescGZIP(), []int{27} } func (x *VerifyItem) GetName() string { @@ -2003,7 +2056,7 @@ type NameItem struct { func (x *NameItem) Reset() { *x = NameItem{} - mi := &file_product_product_proto_msgTypes[27] + mi := &file_product_product_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2015,7 +2068,7 @@ func (x *NameItem) String() string { func (*NameItem) ProtoMessage() {} func (x *NameItem) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[27] + mi := &file_product_product_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2028,7 +2081,7 @@ func (x *NameItem) ProtoReflect() protoreflect.Message { // Deprecated: Use NameItem.ProtoReflect.Descriptor instead. func (*NameItem) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{27} + return file_product_product_proto_rawDescGZIP(), []int{28} } func (x *NameItem) GetId() int64 { @@ -2089,7 +2142,7 @@ type Item struct { func (x *Item) Reset() { *x = Item{} - mi := &file_product_product_proto_msgTypes[28] + mi := &file_product_product_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2101,7 +2154,7 @@ func (x *Item) String() string { func (*Item) ProtoMessage() {} func (x *Item) ProtoReflect() protoreflect.Message { - mi := &file_product_product_proto_msgTypes[28] + mi := &file_product_product_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2114,7 +2167,7 @@ func (x *Item) ProtoReflect() protoreflect.Message { // Deprecated: Use Item.ProtoReflect.Descriptor instead. func (*Item) Descriptor() ([]byte, []int) { - return file_product_product_proto_rawDescGZIP(), []int{28} + return file_product_product_proto_rawDescGZIP(), []int{29} } func (x *Item) GetId() int64 { @@ -2427,7 +2480,10 @@ const file_product_product_proto_rawDesc = "" + "\bItemsReq\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + "\x04page\x18\x02 \x01(\rR\x04page\x12\x1b\n" + - "\tpage_size\x18\x03 \x01(\rR\bpageSize\"\n" + + "\tpage_size\x18\x03 \x01(\rR\bpageSize\">\n" + + "\x10InternalItemsReq\x12\x16\n" + + "\x06status\x18\x01 \x03(\rR\x06status\x12\x12\n" + + "\x04type\x18\x02 \x03(\rR\x04type\"\n" + "\n" + "\bNamesReq\"K\n" + "\tStatusReq\x12\x0e\n" + @@ -2615,7 +2671,7 @@ const file_product_product_proto_rawDesc = "" + "\x06reason\x18\" \x01(\tR\x06reason\x12\x1d\n" + "\n" + "admin_name\x18# \x01(\tR\tadminName\x12\x12\n" + - "\x04edit\x18$ \x01(\rR\x04edit2\x8d\r\n" + + "\x04edit\x18$ \x01(\rR\x04edit2\xd2\r\n" + "\aProduct\x12M\n" + "\x06Create\x12\x12.product.CreateReq\x1a\x11.product.Response\"\x1c\x82\xd3\xe4\x93\x02\x16:\x01*\"\x11/admin/v3/product\x12N\n" + "\x04Info\x12\x10.product.InfoReq\x1a\x11.product.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\x12\x16/admin/v3/product/info\x12K\n" + @@ -2637,7 +2693,8 @@ const file_product_product_proto_rawDesc = "" + "\vNumberItems\x12\x17.product.NumberItemsReq\x1a\x16.google.protobuf.Empty\x12/\n" + "\bInfoById\x12\x14.product.InfoByIdReq\x1a\r.product.Item\x12=\n" + "\n" + - "ItemsByIds\x12\x16.product.ItemsByIdsReq\x1a\x17.product.ItemsByIdsDataB\x1bZ\x19lone-services/rpc/productb\x06proto3" + "ItemsByIds\x12\x16.product.ItemsByIdsReq\x1a\x17.product.ItemsByIdsData\x12C\n" + + "\rInternalItems\x12\x19.product.InternalItemsReq\x1a\x17.product.ItemsByIdsDataB\x1bZ\x19lone-services/rpc/productb\x06proto3" var ( file_product_product_proto_rawDescOnce sync.Once @@ -2651,7 +2708,7 @@ func file_product_product_proto_rawDescGZIP() []byte { return file_product_product_proto_rawDescData } -var file_product_product_proto_msgTypes = make([]protoimpl.MessageInfo, 29) +var file_product_product_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_product_product_proto_goTypes = []any{ (*Response)(nil), // 0: product.Response (*InfoByIdReq)(nil), // 1: product.InfoByIdReq @@ -2660,79 +2717,82 @@ var file_product_product_proto_goTypes = []any{ (*CreateReq)(nil), // 4: product.CreateReq (*InfoReq)(nil), // 5: product.InfoReq (*ItemsReq)(nil), // 6: product.ItemsReq - (*NamesReq)(nil), // 7: product.NamesReq - (*StatusReq)(nil), // 8: product.StatusReq - (*SortReq)(nil), // 9: product.SortReq - (*VerifyReq)(nil), // 10: product.VerifyReq - (*VerifyStatusReq)(nil), // 11: product.VerifyStatusReq - (*EditApplyReq)(nil), // 12: product.EditApplyReq - (*EditApplyPassReq)(nil), // 13: product.EditApplyPassReq - (*EditBaseReq)(nil), // 14: product.EditBaseReq - (*EditSusceptibleReq)(nil), // 15: product.EditSusceptibleReq - (*NumberReq)(nil), // 16: product.NumberReq - (*NumberItem)(nil), // 17: product.NumberItem - (*NumberItemsReq)(nil), // 18: product.NumberItemsReq - (*NumberAddReq)(nil), // 19: product.NumberAddReq - (*ApiItemsReq)(nil), // 20: product.ApiItemsReq - (*ApiInfoReq)(nil), // 21: product.ApiInfoReq - (*ApiItem)(nil), // 22: product.ApiItem - (*ItemsData)(nil), // 23: product.ItemsData - (*VerifyItemsData)(nil), // 24: product.VerifyItemsData - (*VerifyParams)(nil), // 25: product.VerifyParams - (*VerifyItem)(nil), // 26: product.VerifyItem - (*NameItem)(nil), // 27: product.NameItem - (*Item)(nil), // 28: product.Item - (*emptypb.Empty)(nil), // 29: google.protobuf.Empty + (*InternalItemsReq)(nil), // 7: product.InternalItemsReq + (*NamesReq)(nil), // 8: product.NamesReq + (*StatusReq)(nil), // 9: product.StatusReq + (*SortReq)(nil), // 10: product.SortReq + (*VerifyReq)(nil), // 11: product.VerifyReq + (*VerifyStatusReq)(nil), // 12: product.VerifyStatusReq + (*EditApplyReq)(nil), // 13: product.EditApplyReq + (*EditApplyPassReq)(nil), // 14: product.EditApplyPassReq + (*EditBaseReq)(nil), // 15: product.EditBaseReq + (*EditSusceptibleReq)(nil), // 16: product.EditSusceptibleReq + (*NumberReq)(nil), // 17: product.NumberReq + (*NumberItem)(nil), // 18: product.NumberItem + (*NumberItemsReq)(nil), // 19: product.NumberItemsReq + (*NumberAddReq)(nil), // 20: product.NumberAddReq + (*ApiItemsReq)(nil), // 21: product.ApiItemsReq + (*ApiInfoReq)(nil), // 22: product.ApiInfoReq + (*ApiItem)(nil), // 23: product.ApiItem + (*ItemsData)(nil), // 24: product.ItemsData + (*VerifyItemsData)(nil), // 25: product.VerifyItemsData + (*VerifyParams)(nil), // 26: product.VerifyParams + (*VerifyItem)(nil), // 27: product.VerifyItem + (*NameItem)(nil), // 28: product.NameItem + (*Item)(nil), // 29: product.Item + (*emptypb.Empty)(nil), // 30: google.protobuf.Empty } var file_product_product_proto_depIdxs = []int32{ - 28, // 0: product.ItemsByIdsData.items:type_name -> product.Item - 17, // 1: product.NumberItemsReq.items:type_name -> product.NumberItem - 28, // 2: product.ItemsData.items:type_name -> product.Item - 26, // 3: product.VerifyItemsData.items:type_name -> product.VerifyItem - 25, // 4: product.VerifyItem.new:type_name -> product.VerifyParams - 25, // 5: product.VerifyItem.old:type_name -> product.VerifyParams + 29, // 0: product.ItemsByIdsData.items:type_name -> product.Item + 18, // 1: product.NumberItemsReq.items:type_name -> product.NumberItem + 29, // 2: product.ItemsData.items:type_name -> product.Item + 27, // 3: product.VerifyItemsData.items:type_name -> product.VerifyItem + 26, // 4: product.VerifyItem.new:type_name -> product.VerifyParams + 26, // 5: product.VerifyItem.old:type_name -> product.VerifyParams 4, // 6: product.Product.Create:input_type -> product.CreateReq 5, // 7: product.Product.Info:input_type -> product.InfoReq 6, // 8: product.Product.Items:input_type -> product.ItemsReq - 7, // 9: product.Product.Names:input_type -> product.NamesReq - 8, // 10: product.Product.Status:input_type -> product.StatusReq - 9, // 11: product.Product.Sort:input_type -> product.SortReq - 10, // 12: product.Product.Verify:input_type -> product.VerifyReq - 11, // 13: product.Product.VerifyFirst:input_type -> product.VerifyStatusReq - 11, // 14: product.Product.VerifySecond:input_type -> product.VerifyStatusReq - 12, // 15: product.Product.EditApply:input_type -> product.EditApplyReq - 14, // 16: product.Product.EditBase:input_type -> product.EditBaseReq - 15, // 17: product.Product.EditSusceptible:input_type -> product.EditSusceptibleReq - 13, // 18: product.Product.EditApplyPass:input_type -> product.EditApplyPassReq - 19, // 19: product.Product.NumberAdd:input_type -> product.NumberAddReq - 20, // 20: product.Product.ApiItems:input_type -> product.ApiItemsReq - 21, // 21: product.Product.ApiInfo:input_type -> product.ApiInfoReq - 16, // 22: product.Product.Number:input_type -> product.NumberReq - 18, // 23: product.Product.NumberItems:input_type -> product.NumberItemsReq + 8, // 9: product.Product.Names:input_type -> product.NamesReq + 9, // 10: product.Product.Status:input_type -> product.StatusReq + 10, // 11: product.Product.Sort:input_type -> product.SortReq + 11, // 12: product.Product.Verify:input_type -> product.VerifyReq + 12, // 13: product.Product.VerifyFirst:input_type -> product.VerifyStatusReq + 12, // 14: product.Product.VerifySecond:input_type -> product.VerifyStatusReq + 13, // 15: product.Product.EditApply:input_type -> product.EditApplyReq + 15, // 16: product.Product.EditBase:input_type -> product.EditBaseReq + 16, // 17: product.Product.EditSusceptible:input_type -> product.EditSusceptibleReq + 14, // 18: product.Product.EditApplyPass:input_type -> product.EditApplyPassReq + 20, // 19: product.Product.NumberAdd:input_type -> product.NumberAddReq + 21, // 20: product.Product.ApiItems:input_type -> product.ApiItemsReq + 22, // 21: product.Product.ApiInfo:input_type -> product.ApiInfoReq + 17, // 22: product.Product.Number:input_type -> product.NumberReq + 19, // 23: product.Product.NumberItems:input_type -> product.NumberItemsReq 1, // 24: product.Product.InfoById:input_type -> product.InfoByIdReq 2, // 25: product.Product.ItemsByIds:input_type -> product.ItemsByIdsReq - 0, // 26: product.Product.Create:output_type -> product.Response - 0, // 27: product.Product.Info:output_type -> product.Response - 0, // 28: product.Product.Items:output_type -> product.Response - 0, // 29: product.Product.Names:output_type -> product.Response - 0, // 30: product.Product.Status:output_type -> product.Response - 0, // 31: product.Product.Sort:output_type -> product.Response - 0, // 32: product.Product.Verify:output_type -> product.Response - 0, // 33: product.Product.VerifyFirst:output_type -> product.Response - 0, // 34: product.Product.VerifySecond:output_type -> product.Response - 0, // 35: product.Product.EditApply:output_type -> product.Response - 0, // 36: product.Product.EditBase:output_type -> product.Response - 0, // 37: product.Product.EditSusceptible:output_type -> product.Response - 0, // 38: product.Product.EditApplyPass:output_type -> product.Response - 0, // 39: product.Product.NumberAdd:output_type -> product.Response - 0, // 40: product.Product.ApiItems:output_type -> product.Response - 0, // 41: product.Product.ApiInfo:output_type -> product.Response - 29, // 42: product.Product.Number:output_type -> google.protobuf.Empty - 29, // 43: product.Product.NumberItems:output_type -> google.protobuf.Empty - 28, // 44: product.Product.InfoById:output_type -> product.Item - 3, // 45: product.Product.ItemsByIds:output_type -> product.ItemsByIdsData - 26, // [26:46] is the sub-list for method output_type - 6, // [6:26] is the sub-list for method input_type + 7, // 26: product.Product.InternalItems:input_type -> product.InternalItemsReq + 0, // 27: product.Product.Create:output_type -> product.Response + 0, // 28: product.Product.Info:output_type -> product.Response + 0, // 29: product.Product.Items:output_type -> product.Response + 0, // 30: product.Product.Names:output_type -> product.Response + 0, // 31: product.Product.Status:output_type -> product.Response + 0, // 32: product.Product.Sort:output_type -> product.Response + 0, // 33: product.Product.Verify:output_type -> product.Response + 0, // 34: product.Product.VerifyFirst:output_type -> product.Response + 0, // 35: product.Product.VerifySecond:output_type -> product.Response + 0, // 36: product.Product.EditApply:output_type -> product.Response + 0, // 37: product.Product.EditBase:output_type -> product.Response + 0, // 38: product.Product.EditSusceptible:output_type -> product.Response + 0, // 39: product.Product.EditApplyPass:output_type -> product.Response + 0, // 40: product.Product.NumberAdd:output_type -> product.Response + 0, // 41: product.Product.ApiItems:output_type -> product.Response + 0, // 42: product.Product.ApiInfo:output_type -> product.Response + 30, // 43: product.Product.Number:output_type -> google.protobuf.Empty + 30, // 44: product.Product.NumberItems:output_type -> google.protobuf.Empty + 29, // 45: product.Product.InfoById:output_type -> product.Item + 3, // 46: product.Product.ItemsByIds:output_type -> product.ItemsByIdsData + 3, // 47: product.Product.InternalItems:output_type -> product.ItemsByIdsData + 27, // [27:48] is the sub-list for method output_type + 6, // [6:27] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension extendee 0, // [0:6] is the sub-list for field type_name @@ -2749,7 +2809,7 @@ func file_product_product_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_product_product_proto_rawDesc), len(file_product_product_proto_rawDesc)), NumEnums: 0, - NumMessages: 29, + NumMessages: 30, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/product/pb/product_grpc.pb.go b/rpc/product/pb/product_grpc.pb.go index b4818d8..dcf621f 100644 --- a/rpc/product/pb/product_grpc.pb.go +++ b/rpc/product/pb/product_grpc.pb.go @@ -40,6 +40,7 @@ const ( Product_NumberItems_FullMethodName = "/product.Product/NumberItems" Product_InfoById_FullMethodName = "/product.Product/InfoById" Product_ItemsByIds_FullMethodName = "/product.Product/ItemsByIds" + Product_InternalItems_FullMethodName = "/product.Product/InternalItems" ) // ProductClient is the client API for Product service. @@ -78,6 +79,7 @@ type ProductClient interface { InfoById(ctx context.Context, in *InfoByIdReq, opts ...grpc.CallOption) (*Item, error) // 获取多个产品详情 ItemsByIds(ctx context.Context, in *ItemsByIdsReq, opts ...grpc.CallOption) (*ItemsByIdsData, error) + InternalItems(ctx context.Context, in *InternalItemsReq, opts ...grpc.CallOption) (*ItemsByIdsData, error) } type productClient struct { @@ -288,6 +290,16 @@ func (c *productClient) ItemsByIds(ctx context.Context, in *ItemsByIdsReq, opts return out, nil } +func (c *productClient) InternalItems(ctx context.Context, in *InternalItemsReq, opts ...grpc.CallOption) (*ItemsByIdsData, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ItemsByIdsData) + err := c.cc.Invoke(ctx, Product_InternalItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // ProductServer is the server API for Product service. // All implementations must embed UnimplementedProductServer // for forward compatibility. @@ -324,6 +336,7 @@ type ProductServer interface { InfoById(context.Context, *InfoByIdReq) (*Item, error) // 获取多个产品详情 ItemsByIds(context.Context, *ItemsByIdsReq) (*ItemsByIdsData, error) + InternalItems(context.Context, *InternalItemsReq) (*ItemsByIdsData, error) mustEmbedUnimplementedProductServer() } @@ -394,6 +407,9 @@ func (UnimplementedProductServer) InfoById(context.Context, *InfoByIdReq) (*Item func (UnimplementedProductServer) ItemsByIds(context.Context, *ItemsByIdsReq) (*ItemsByIdsData, error) { return nil, status.Error(codes.Unimplemented, "method ItemsByIds not implemented") } +func (UnimplementedProductServer) InternalItems(context.Context, *InternalItemsReq) (*ItemsByIdsData, error) { + return nil, status.Error(codes.Unimplemented, "method InternalItems not implemented") +} func (UnimplementedProductServer) mustEmbedUnimplementedProductServer() {} func (UnimplementedProductServer) testEmbeddedByValue() {} @@ -775,6 +791,24 @@ func _Product_ItemsByIds_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Product_InternalItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InternalItemsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProductServer).InternalItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Product_InternalItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProductServer).InternalItems(ctx, req.(*InternalItemsReq)) + } + return interceptor(ctx, in, info, handler) +} + // Product_ServiceDesc is the grpc.ServiceDesc for Product service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -862,6 +896,10 @@ var Product_ServiceDesc = grpc.ServiceDesc{ MethodName: "ItemsByIds", Handler: _Product_ItemsByIds_Handler, }, + { + MethodName: "InternalItems", + Handler: _Product_InternalItems_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "product/product.proto", diff --git a/rpc/product/product.pb b/rpc/product/product.pb index 3f045a6e57fb5341771478556db8e15619d59e95..1f32aa69990d594a32e89f415dfc111d24dd28fd 100644 GIT binary patch delta 137 zcmZ2IpK-$i#tqD7Osh>cvzk@0*x7Ljc;=O)7Ud=8c$TE*76+vk3W;&C6_+HIlom@c zDllvC20?j3LR>5*l?AC1OkhzEdvmQ-6(8fJ%|AT)*ffNkxp+~`5|Y#_D9TSMO)k+x K7N4By?*ssVRxC0A delta 33 pcmdn6fN}MF#tqD7Ov{Wnvzk@0Y~F8G!N=IU*}}7rZ8CR&Dge(e3upiU diff --git a/rpc/product/product.proto b/rpc/product/product.proto index 431b3b4..18c159f 100644 --- a/rpc/product/product.proto +++ b/rpc/product/product.proto @@ -124,6 +124,7 @@ service Product { rpc InfoById(InfoByIdReq) returns (Item); // 获取多个产品详情 rpc ItemsByIds(ItemsByIdsReq) returns (ItemsByIdsData); + rpc InternalItems(InternalItemsReq) returns (ItemsByIdsData); } message Response { @@ -183,6 +184,12 @@ message ItemsReq { uint32 page_size = 3; } +// 内部产品列表;status、type 为空则不加对应筛选条件 +message InternalItemsReq { + repeated uint32 status = 1; + repeated uint32 type = 2; +} + message NamesReq {} message StatusReq { diff --git a/services/chore/choreclient/chore.go b/services/chore/choreclient/chore.go index b8a7ac4..91bb498 100644 --- a/services/chore/choreclient/chore.go +++ b/services/chore/choreclient/chore.go @@ -15,6 +15,7 @@ import ( type ( DecryptMobileReq = chore.DecryptMobileReq + DocumentReq = chore.DocumentReq EditReq = chore.EditReq EmptyReq = chore.EmptyReq IdReq = chore.IdReq @@ -55,6 +56,7 @@ type ( SystemStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Response, error) SystemInfo(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*Response, error) SystemItems(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error) + Document(ctx context.Context, in *DocumentReq, opts ...grpc.CallOption) (*Response, error) RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error) InternalActionApplyLogCreate(ctx context.Context, in *InternalActionApplyLogCreateReq, opts ...grpc.CallOption) (*InternalActionApplyLogCreateData, error) SendPassword(ctx context.Context, in *SendPasswordReq, opts ...grpc.CallOption) (*SendPasswordResp, error) @@ -153,6 +155,11 @@ func (m *defaultChore) SystemItems(ctx context.Context, in *EmptyReq, opts ...gr return client.SystemItems(ctx, in, opts...) } +func (m *defaultChore) Document(ctx context.Context, in *DocumentReq, opts ...grpc.CallOption) (*Response, error) { + client := chore.NewChoreClient(m.cli.Conn()) + return client.Document(ctx, in, opts...) +} + func (m *defaultChore) RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error) { client := chore.NewChoreClient(m.cli.Conn()) return client.RegionsByIds(ctx, in, opts...) diff --git a/services/chore/internal/dao/document.go b/services/chore/internal/dao/document.go new file mode 100644 index 0000000..bbd8d9b --- /dev/null +++ b/services/chore/internal/dao/document.go @@ -0,0 +1,13 @@ +package dao + +const ( + // type: 1联系方式 2小程序门店关于我们 3小程序门店合作声明 4用户服务协议 5隐私政策 6打印机数据 7APP服务协议 8APP隐私政策 + DocumentStatusNormal int32 = 1 + DocumentStatusDisabled int32 = 2 +) + +type DocumentInfo struct { + Id int64 `gorm:"column:id" json:"id"` + Type int32 `gorm:"column:type" json:"type"` + Content string `gorm:"column:content" json:"content"` +} diff --git a/services/chore/internal/logic/documentLogic.go b/services/chore/internal/logic/documentLogic.go new file mode 100644 index 0000000..9b08ce6 --- /dev/null +++ b/services/chore/internal/logic/documentLogic.go @@ -0,0 +1,55 @@ +package logic + +import ( + "context" + "strconv" + + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + chore "lone-services/rpc/chore/pb" + "lone-services/services/chore/internal/dao" + "lone-services/services/chore/internal/model" + "lone-services/services/chore/internal/svc" + "lone-services/services/chore/validator" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DocumentLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewDocumentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocumentLogic { + return &DocumentLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *DocumentLogic) Document(in *chore.DocumentReq) (*chore.Response, error) { + var v validator.DocumentValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + + var info dao.DocumentInfo + err := model.DocumentModel{}.Init().GetOne(modelbase.Params{ + Eq: map[string]string{ + "type": strconv.Itoa(int(in.Type)), + "status": strconv.Itoa(int(dao.DocumentStatusNormal)), + }, + }, &info) + if err != nil { + l.Errorf("document get: %v", err) + return l.fail(utils.Fail) + } + if info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + return l.ok(info) +} diff --git a/services/chore/internal/logic/testLogic.go b/services/chore/internal/logic/testLogic.go index 8d3d25f..fb55378 100644 --- a/services/chore/internal/logic/testLogic.go +++ b/services/chore/internal/logic/testLogic.go @@ -7,7 +7,7 @@ import ( "lone-services/pkg/rpcclient" "lone-services/pkg/utils" chore "lone-services/rpc/chore/pb" - user "lone-services/rpc/user/pb" + product "lone-services/rpc/product/pb" "lone-services/services/chore/internal/svc" "github.com/zeromicro/go-zero/core/logx" @@ -32,9 +32,9 @@ func NewTestLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TestLogic { } func (l *TestLogic) Test(in *chore.TestReq) (*chore.Response, error) { - // cli, err := rpcclient.Get(l.svcCtx.ProductSvcName) + cli, err := rpcclient.Get(l.svcCtx.ProductSvcName) // cli, err := rpcclient.Get(l.svcCtx.SaleSvcName) - cli, err := rpcclient.Get(l.svcCtx.UserSvcName) + // cli, err := rpcclient.Get(l.svcCtx.UserSvcName) if err != nil { l.Errorf("get rpc: %v", err) @@ -114,12 +114,12 @@ func (l *TestLogic) Test(in *chore.TestReq) (*chore.Response, error) { // Mobile: in.GetChar(), // }) - res, err := user.NewUserClient(cli.Conn()).InternalCheckUpdate(l.ctx, &user.InternalCheckUpdateReq{ - BizId: int64(in.GetId()), - SubjectType: "user", - Mobile: in.GetChar(), - }) - fmt.Println(res.GetResult()) + // res, err := user.NewUserClient(cli.Conn()).InternalCheckUpdate(l.ctx, &user.InternalCheckUpdateReq{ + // BizId: int64(in.GetId()), + // SubjectType: "user", + // Mobile: in.GetChar(), + // }) + // fmt.Println(res.GetResult()) // res, err := user.NewUserClient(cli.Conn()).InternalCreate(l.ctx, &user.InternalCreateReq{ // BizId: 10086, @@ -129,6 +129,13 @@ func (l *TestLogic) Test(in *chore.TestReq) (*chore.Response, error) { // Identifier: in.GetChar(), // Secret: "123123", // }) + + res, err := product.NewProductClient(cli.Conn()).InternalItems(l.ctx, &product.InternalItemsReq{ + Status: []uint32{}, + Type: []uint32{}, + }) + + fmt.Println(res.GetItems()) if err != nil { l.Errorf("XXXXXX: %v", err) return failResponse(utils.ErrorInternalServer), nil diff --git a/services/chore/internal/model/document.go b/services/chore/internal/model/document.go new file mode 100644 index 0000000..b05b1c9 --- /dev/null +++ b/services/chore/internal/model/document.go @@ -0,0 +1,16 @@ +package model + +import "lone-services/pkg/modelbase" + +type DocumentModel struct { + modelbase.Base +} + +func (m DocumentModel) TableName() string { + return modelbase.Prefix() + "document" +} + +func (m DocumentModel) Init() DocumentModel { + m.Table = m.TableName() + return m +} diff --git a/services/chore/internal/server/choreServer.go b/services/chore/internal/server/choreServer.go index 381b1d4..7ed9c8b 100644 --- a/services/chore/internal/server/choreServer.go +++ b/services/chore/internal/server/choreServer.go @@ -105,6 +105,11 @@ func (s *ChoreServer) SystemItems(ctx context.Context, in *chore.EmptyReq) (*cho return l.SystemItems(in) } +func (s *ChoreServer) Document(ctx context.Context, in *chore.DocumentReq) (*chore.Response, error) { + l := logic.NewDocumentLogic(ctx, s.svcCtx) + return l.Document(in) +} + func (s *ChoreServer) RegionsByIds(ctx context.Context, in *chore.RegionsByIdsReq) (*chore.RegionsByIdsData, error) { l := logic.NewRegionsByIdsLogic(ctx, s.svcCtx) return l.RegionsByIds(in) diff --git a/services/chore/validator/document.go b/services/chore/validator/document.go new file mode 100644 index 0000000..cd9c248 --- /dev/null +++ b/services/chore/validator/document.go @@ -0,0 +1,14 @@ +package validator + +import "lone-services/pkg/validate" + +type DocumentValidator struct { + Type int32 `validate:"required,gt=0"` +} + +func (p DocumentValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "Type.required": "类型不能为空", + "Type.gt": "类型必须大于0", + } +} diff --git a/services/message/internal/logic/apiMessageLogic.go b/services/message/internal/logic/apiMessageLogic.go index 4796e78..1b1e1f2 100644 --- a/services/message/internal/logic/apiMessageLogic.go +++ b/services/message/internal/logic/apiMessageLogic.go @@ -2,14 +2,13 @@ package logic import ( "context" - "lone-services/pkg/modelbase" - "lone-services/pkg/utils" - "lone-services/services/message/internal/dao" - "lone-services/services/message/internal/model" - "lone-services/services/message/validator" "strconv" - "lone-services/rpc/message/pb" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + message "lone-services/rpc/message/pb" + "lone-services/services/message/internal/dao" + "lone-services/services/message/internal/model" "lone-services/services/message/internal/svc" "github.com/zeromicro/go-zero/core/logx" @@ -30,37 +29,51 @@ func NewApiMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ApiMes } } -func (l *ApiMessageLogic) ApiMessage(in *message.ItemsRequest) (*message.Response, error) { - var v validator.MessageItemsValidator - if fail := l.checkParams(in, &v); fail != nil { - return fail, nil - } - adminInfo := utils.GetUserFromCtx(l.ctx) - if adminInfo.ID < utils.NumberOne { +func (l *ApiMessageLogic) ApiMessage(in *message.ApiMessageNumberRequest) (*message.Response, error) { + loginUser := utils.GetUserFromCtx(l.ctx) + if loginUser.ID < utils.NumberOne { return l.fail(utils.ErrorNoLoginInfo) } + + eq := map[string]string{ + "target_id": strconv.FormatInt(loginUser.ID, utils.NumberTen), + } + if in.Type > utils.NumberZero { + eq["type"] = strconv.Itoa(int(in.Type)) + } + var info []dao.MessageInfo w := modelbase.Params{ - Page: int(in.Page), - Size: int(in.Size), + Page: modelbase.DefaultPage, + Size: 10, Order: "id desc", + Eq: eq, } - items, err := model.MessageModel{}.Init().Page(w, &info) + messageModel := model.MessageModel{}.Init() + _, err := messageModel.Page(w, &info) if err != nil { - l.Logger.Error("get message list failed", err) + l.Errorf("get message list failed: %v", err) return l.fail(utils.Fail) } - var ids []string - for _, v := range info { - ids = append(ids, strconv.Itoa(int(v.Id))) + + if len(info) > utils.NumberZero { + ids := make([]string, 0, len(info)) + for _, row := range info { + ids = append(ids, strconv.FormatInt(row.Id, utils.NumberTen)) + } + _, editErr := messageModel.Edit(modelbase.Params{ + In: map[string][]string{"id": ids}, + Eq: map[string]string{"target_id": strconv.FormatInt(loginUser.ID, utils.NumberTen)}, + }, &dao.MessageStatus{Status: utils.StatusOk}) + if editErr != nil { + l.Errorf("mark message read failed: %v", editErr) + return l.fail(utils.Fail) + } + for i := range info { + info[i].Status = utils.StatusOk + } } - if len(ids) > utils.NumberZero { - status := dao.MessageStatus{Status: utils.StatusOk} - - ww := modelbase.Params{In: map[string][]string{"id": ids}} - _, err = model.MessageModel{}.Init().Edit(ww, &status) - } - return l.ok(items) + return l.ok(info) } diff --git a/services/message/internal/logic/apiMessageNumberLogic.go b/services/message/internal/logic/apiMessageNumberLogic.go index 053ee60..22c190e 100644 --- a/services/message/internal/logic/apiMessageNumberLogic.go +++ b/services/message/internal/logic/apiMessageNumberLogic.go @@ -2,14 +2,15 @@ package logic import ( "context" - "lone-services/pkg/modelbase" - "lone-services/pkg/utils" - "lone-services/services/message/internal/dao" - "lone-services/services/message/internal/model" "strconv" - "lone-services/rpc/message/pb" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + message "lone-services/rpc/message/pb" + "lone-services/services/message/internal/dao" + "lone-services/services/message/internal/model" "lone-services/services/message/internal/svc" + "lone-services/services/message/validator" "github.com/zeromicro/go-zero/core/logx" ) @@ -30,8 +31,13 @@ func NewApiMessageNumberLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } func (l *ApiMessageNumberLogic) ApiMessageNumber(in *message.ApiMessageNumberRequest) (*message.Response, error) { - adminInfo := utils.GetUserFromCtx(l.ctx) - if adminInfo.ID < utils.NumberOne { + var v validator.MessageNumberValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + + loginUser := utils.GetUserFromCtx(l.ctx) + if loginUser.ID < utils.NumberOne { return l.fail(utils.ErrorNoLoginInfo) } @@ -39,14 +45,14 @@ func (l *ApiMessageNumberLogic) ApiMessageNumber(in *message.ApiMessageNumberReq w := modelbase.Params{ Eq: map[string]string{ "status": strconv.Itoa(utils.StatusFail), - "target_id": strconv.FormatInt(adminInfo.ID, utils.NumberTen), + "target_id": strconv.FormatInt(loginUser.ID, utils.NumberTen), "type": strconv.Itoa(int(in.Type)), }, } count, err := model.MessageModel{}.Init().Count(w, &info) if err != nil { - utils.Logger.Error(err) + l.Errorf("count unread message failed: %v", err) return l.fail(utils.Fail) } return l.ok(count) diff --git a/services/message/internal/server/messageServer.go b/services/message/internal/server/messageServer.go index c7cca15..9592e54 100644 --- a/services/message/internal/server/messageServer.go +++ b/services/message/internal/server/messageServer.go @@ -1,5 +1,5 @@ // Code generated by goctl. DO NOT EDIT. -// goctl 1.10.2 +// goctl 1.10.1 // Source: message.proto package server @@ -28,7 +28,7 @@ func (s *MessageServer) AdminMessage(ctx context.Context, in *message.ItemsReque return l.AdminMessage(in) } -func (s *MessageServer) ApiMessage(ctx context.Context, in *message.ItemsRequest) (*message.Response, error) { +func (s *MessageServer) ApiMessage(ctx context.Context, in *message.ApiMessageNumberRequest) (*message.Response, error) { l := logic.NewApiMessageLogic(ctx, s.svcCtx) return l.ApiMessage(in) } diff --git a/services/message/messageclient/message.go b/services/message/messageclient/message.go index d02c71b..78180fc 100644 --- a/services/message/messageclient/message.go +++ b/services/message/messageclient/message.go @@ -1,5 +1,5 @@ // Code generated by goctl. DO NOT EDIT. -// goctl 1.10.2 +// goctl 1.10.1 // Source: message.proto package messageClient @@ -22,7 +22,7 @@ type ( Message interface { AdminMessage(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) - ApiMessage(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) + ApiMessage(ctx context.Context, in *ApiMessageNumberRequest, opts ...grpc.CallOption) (*Response, error) ApiMessageNumber(ctx context.Context, in *ApiMessageNumberRequest, opts ...grpc.CallOption) (*Response, error) MessageAdd(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) } @@ -43,7 +43,7 @@ func (m *defaultMessage) AdminMessage(ctx context.Context, in *ItemsRequest, opt return client.AdminMessage(ctx, in, opts...) } -func (m *defaultMessage) ApiMessage(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) { +func (m *defaultMessage) ApiMessage(ctx context.Context, in *ApiMessageNumberRequest, opts ...grpc.CallOption) (*Response, error) { client := message.NewMessageClient(m.cli.Conn()) return client.ApiMessage(ctx, in, opts...) } diff --git a/services/message/validator/message.go b/services/message/validator/message.go index 7780094..b3350fb 100644 --- a/services/message/validator/message.go +++ b/services/message/validator/message.go @@ -8,20 +8,18 @@ type MessageItemsValidator struct { Type int32 `form:"type" json:"type" validate:"required"` } -// GetMessage 提示消息 func (p MessageItemsValidator) GetMessage() validate.ValidatorMessages { return validate.ValidatorMessages{ - validate.FieldType: validate.FieldType, + validate.FieldType: validate.FieldTypeValue, } } type MessageNumberValidator struct { - Type int32 `form:"type" json:"type" binding:"required"` + Type int32 `form:"type" json:"type" validate:"required"` } -// GetMessage 提示消息 func (p MessageNumberValidator) GetMessage() validate.ValidatorMessages { return validate.ValidatorMessages{ - validate.FieldType: validate.FieldType, + validate.FieldType: validate.FieldTypeValue, } } diff --git a/services/product/internal/logic/internalItemsLogic.go b/services/product/internal/logic/internalItemsLogic.go new file mode 100644 index 0000000..5125b3d --- /dev/null +++ b/services/product/internal/logic/internalItemsLogic.go @@ -0,0 +1,71 @@ +package logic + +import ( + "context" + "strconv" + + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + product "lone-services/rpc/product/pb" + "lone-services/services/product/internal/dao" + "lone-services/services/product/internal/model" + "lone-services/services/product/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type InternalItemsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewInternalItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InternalItemsLogic { + return &InternalItemsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *InternalItemsLogic) InternalItems(in *product.InternalItemsReq) (*product.ItemsByIdsData, error) { + w := modelbase.Params{ + Order: "sort DESC, id DESC", + } + inMap := make(map[string][]string) + if status := toUint32Strings(in.GetStatus()); len(status) > utils.NumberZero { + inMap["status in ?"] = status + } + if types := toUint32Strings(in.GetType()); len(types) > utils.NumberZero { + inMap["type in ?"] = types + } + if len(inMap) > utils.NumberZero { + w.In = inMap + } + + var infos []dao.Info + err := model.ProductModel{}.Init().Items(w, &infos) + if err != nil { + l.Errorf("product InternalItems: %v", err) + return nil, status.Error(codes.Internal, utils.Fail.Msg) + } + + items := make([]*product.Item, 0, len(infos)) + for _, row := range infos { + items = append(items, toProductItem(row)) + } + return &product.ItemsByIdsData{Items: items}, nil +} + +func toUint32Strings(vals []uint32) []string { + if len(vals) < 1 { + return nil + } + out := make([]string, 0, len(vals)) + for _, v := range vals { + out = append(out, strconv.FormatUint(uint64(v), 10)) + } + return out +} diff --git a/services/product/internal/server/productServer.go b/services/product/internal/server/productServer.go index 3fb4ec9..49558c5 100644 --- a/services/product/internal/server/productServer.go +++ b/services/product/internal/server/productServer.go @@ -135,3 +135,8 @@ func (s *ProductServer) ItemsByIds(ctx context.Context, in *product.ItemsByIdsRe l := logic.NewItemsByIdsLogic(ctx, s.svcCtx) return l.ItemsByIds(in) } + +func (s *ProductServer) InternalItems(ctx context.Context, in *product.InternalItemsReq) (*product.ItemsByIdsData, error) { + l := logic.NewInternalItemsLogic(ctx, s.svcCtx) + return l.InternalItems(in) +} diff --git a/services/product/productClient/product.go b/services/product/productClient/product.go index 6696347..9a1963a 100644 --- a/services/product/productClient/product.go +++ b/services/product/productClient/product.go @@ -26,6 +26,7 @@ type ( EditSusceptibleReq = product.EditSusceptibleReq InfoByIdReq = product.InfoByIdReq InfoReq = product.InfoReq + InternalItemsReq = product.InternalItemsReq Item = product.Item ItemsByIdsData = product.ItemsByIdsData ItemsByIdsReq = product.ItemsByIdsReq @@ -79,6 +80,7 @@ type ( InfoById(ctx context.Context, in *InfoByIdReq, opts ...grpc.CallOption) (*Item, error) // 获取多个产品详情 ItemsByIds(ctx context.Context, in *ItemsByIdsReq, opts ...grpc.CallOption) (*ItemsByIdsData, error) + InternalItems(ctx context.Context, in *InternalItemsReq, opts ...grpc.CallOption) (*ItemsByIdsData, error) } defaultProduct struct { @@ -203,3 +205,8 @@ func (m *defaultProduct) ItemsByIds(ctx context.Context, in *ItemsByIdsReq, opts client := product.NewProductClient(m.cli.Conn()) return client.ItemsByIds(ctx, in, opts...) } + +func (m *defaultProduct) InternalItems(ctx context.Context, in *InternalItemsReq, opts ...grpc.CallOption) (*ItemsByIdsData, error) { + client := product.NewProductClient(m.cli.Conn()) + return client.InternalItems(ctx, in, opts...) +}