fix: sale create fields
CI / changes (push) Successful in 14s
CI / docker-bff (push) Successful in 3s
CI / docker-product (push) Successful in 24s
CI / docker-admin (push) Has been skipped
CI / docker-user (push) Has been skipped
CI / docker-ad (push) Has been skipped
CI / docker-chore (push) Successful in 25s
CI / docker-express (push) Has been skipped
CI / docker-sale (push) Successful in 26s

This commit is contained in:
zzw
2026-08-28 15:35:33 +08:00
parent 914a11d05a
commit 53d203ee14
20 changed files with 542 additions and 251 deletions
Binary file not shown.
+16
View File
@@ -27,6 +27,9 @@ service Chore {
get: "/api/v3/chore/regions"
};
}
// 按 id 批量查地区名称
rpc RegionsByIds(RegionsByIdsReq) returns (RegionsByIdsData);
}
message Response {
@@ -51,4 +54,17 @@ message DecryptMobileReq {
message RegionsReq {
int32 parent_id = 1;
}
message RegionsByIdsReq {
repeated int64 ids = 1;
}
message RegionItem {
int64 id = 1;
string name = 2;
}
message RegionsByIdsData {
repeated RegionItem items = 1;
}
+172 -17
View File
@@ -274,6 +274,146 @@ func (x *RegionsReq) GetParentId() int32 {
return 0
}
type RegionsByIdsReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RegionsByIdsReq) Reset() {
*x = RegionsByIdsReq{}
mi := &file_chore_chore_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RegionsByIdsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegionsByIdsReq) ProtoMessage() {}
func (x *RegionsByIdsReq) ProtoReflect() protoreflect.Message {
mi := &file_chore_chore_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RegionsByIdsReq.ProtoReflect.Descriptor instead.
func (*RegionsByIdsReq) Descriptor() ([]byte, []int) {
return file_chore_chore_proto_rawDescGZIP(), []int{5}
}
func (x *RegionsByIdsReq) GetIds() []int64 {
if x != nil {
return x.Ids
}
return nil
}
type RegionItem struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RegionItem) Reset() {
*x = RegionItem{}
mi := &file_chore_chore_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RegionItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegionItem) ProtoMessage() {}
func (x *RegionItem) 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 RegionItem.ProtoReflect.Descriptor instead.
func (*RegionItem) Descriptor() ([]byte, []int) {
return file_chore_chore_proto_rawDescGZIP(), []int{6}
}
func (x *RegionItem) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *RegionItem) GetName() string {
if x != nil {
return x.Name
}
return ""
}
type RegionsByIdsData struct {
state protoimpl.MessageState `protogen:"open.v1"`
Items []*RegionItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RegionsByIdsData) Reset() {
*x = RegionsByIdsData{}
mi := &file_chore_chore_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RegionsByIdsData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegionsByIdsData) ProtoMessage() {}
func (x *RegionsByIdsData) ProtoReflect() protoreflect.Message {
mi := &file_chore_chore_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 RegionsByIdsData.ProtoReflect.Descriptor instead.
func (*RegionsByIdsData) Descriptor() ([]byte, []int) {
return file_chore_chore_proto_rawDescGZIP(), []int{7}
}
func (x *RegionsByIdsData) GetItems() []*RegionItem {
if x != nil {
return x.Items
}
return nil
}
var File_chore_chore_proto protoreflect.FileDescriptor
const file_chore_chore_proto_rawDesc = "" +
@@ -293,12 +433,21 @@ const file_chore_chore_proto_rawDesc = "" +
"\rorigin_mobile\x18\x01 \x01(\tR\foriginMobile\")\n" +
"\n" +
"RegionsReq\x12\x1b\n" +
"\tparent_id\x18\x01 \x01(\x05R\bparentId2\xd0\x02\n" +
"\tparent_id\x18\x01 \x01(\x05R\bparentId\"#\n" +
"\x0fRegionsByIdsReq\x12\x10\n" +
"\x03ids\x18\x01 \x03(\x03R\x03ids\"0\n" +
"\n" +
"RegionItem\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\";\n" +
"\x10RegionsByIdsData\x12'\n" +
"\x05items\x18\x01 \x03(\v2\x11.chore.RegionItemR\x05items2\x91\x03\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\x12F\n" +
"\x04Test\x12\x0e.chore.TestReq\x1a\x0f.chore.Response\"\x1d\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/api/v3/chore/test\x12_\n" +
"\rDecryptMobile\x12\x17.chore.DecryptMobileReq\x1a\x0f.chore.Response\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/api/v3/chore/decrypt/mobile\x12L\n" +
"\aRegions\x12\x11.chore.RegionsReq\x1a\x0f.chore.Response\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/api/v3/chore/regionsB\x19Z\x17lone-services/rpc/choreb\x06proto3"
"\aRegions\x12\x11.chore.RegionsReq\x1a\x0f.chore.Response\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/api/v3/chore/regions\x12?\n" +
"\fRegionsByIds\x12\x16.chore.RegionsByIdsReq\x1a\x17.chore.RegionsByIdsDataB\x19Z\x17lone-services/rpc/choreb\x06proto3"
var (
file_chore_chore_proto_rawDescOnce sync.Once
@@ -312,28 +461,34 @@ func file_chore_chore_proto_rawDescGZIP() []byte {
return file_chore_chore_proto_rawDescData
}
var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_chore_chore_proto_goTypes = []any{
(*Response)(nil), // 0: chore.Response
(*PolicyReq)(nil), // 1: chore.PolicyReq
(*TestReq)(nil), // 2: chore.TestReq
(*DecryptMobileReq)(nil), // 3: chore.DecryptMobileReq
(*RegionsReq)(nil), // 4: chore.RegionsReq
(*RegionsByIdsReq)(nil), // 5: chore.RegionsByIdsReq
(*RegionItem)(nil), // 6: chore.RegionItem
(*RegionsByIdsData)(nil), // 7: chore.RegionsByIdsData
}
var file_chore_chore_proto_depIdxs = []int32{
1, // 0: chore.Chore.Policy:input_type -> chore.PolicyReq
2, // 1: chore.Chore.Test:input_type -> chore.TestReq
3, // 2: chore.Chore.DecryptMobile:input_type -> chore.DecryptMobileReq
4, // 3: chore.Chore.Regions:input_type -> chore.RegionsReq
0, // 4: chore.Chore.Policy:output_type -> chore.Response
0, // 5: chore.Chore.Test:output_type -> chore.Response
0, // 6: chore.Chore.DecryptMobile:output_type -> chore.Response
0, // 7: chore.Chore.Regions:output_type -> chore.Response
4, // [4:8] is the sub-list for method output_type
0, // [0:4] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
6, // 0: chore.RegionsByIdsData.items:type_name -> chore.RegionItem
1, // 1: chore.Chore.Policy:input_type -> chore.PolicyReq
2, // 2: chore.Chore.Test:input_type -> chore.TestReq
3, // 3: chore.Chore.DecryptMobile:input_type -> chore.DecryptMobileReq
4, // 4: chore.Chore.Regions:input_type -> chore.RegionsReq
5, // 5: chore.Chore.RegionsByIds:input_type -> chore.RegionsByIdsReq
0, // 6: chore.Chore.Policy:output_type -> chore.Response
0, // 7: chore.Chore.Test:output_type -> chore.Response
0, // 8: chore.Chore.DecryptMobile:output_type -> chore.Response
0, // 9: chore.Chore.Regions:output_type -> chore.Response
7, // 10: chore.Chore.RegionsByIds:output_type -> chore.RegionsByIdsData
6, // [6:11] is the sub-list for method output_type
1, // [1:6] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_chore_chore_proto_init() }
@@ -347,7 +502,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: 5,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
+40
View File
@@ -23,6 +23,7 @@ const (
Chore_Test_FullMethodName = "/chore.Chore/Test"
Chore_DecryptMobile_FullMethodName = "/chore.Chore/DecryptMobile"
Chore_Regions_FullMethodName = "/chore.Chore/Regions"
Chore_RegionsByIds_FullMethodName = "/chore.Chore/RegionsByIds"
)
// ChoreClient is the client API for Chore service.
@@ -33,6 +34,8 @@ type ChoreClient interface {
Test(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*Response, error)
DecryptMobile(ctx context.Context, in *DecryptMobileReq, opts ...grpc.CallOption) (*Response, error)
Regions(ctx context.Context, in *RegionsReq, opts ...grpc.CallOption) (*Response, error)
// 服务间调用:按 id 批量查地区名称
RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error)
}
type choreClient struct {
@@ -83,6 +86,16 @@ func (c *choreClient) Regions(ctx context.Context, in *RegionsReq, opts ...grpc.
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)
err := c.cc.Invoke(ctx, Chore_RegionsByIds_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ChoreServer is the server API for Chore service.
// All implementations must embed UnimplementedChoreServer
// for forward compatibility.
@@ -91,6 +104,8 @@ type ChoreServer interface {
Test(context.Context, *TestReq) (*Response, error)
DecryptMobile(context.Context, *DecryptMobileReq) (*Response, error)
Regions(context.Context, *RegionsReq) (*Response, error)
// 服务间调用:按 id 批量查地区名称
RegionsByIds(context.Context, *RegionsByIdsReq) (*RegionsByIdsData, error)
mustEmbedUnimplementedChoreServer()
}
@@ -113,6 +128,9 @@ func (UnimplementedChoreServer) DecryptMobile(context.Context, *DecryptMobileReq
func (UnimplementedChoreServer) Regions(context.Context, *RegionsReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method Regions not implemented")
}
func (UnimplementedChoreServer) RegionsByIds(context.Context, *RegionsByIdsReq) (*RegionsByIdsData, error) {
return nil, status.Error(codes.Unimplemented, "method RegionsByIds not implemented")
}
func (UnimplementedChoreServer) mustEmbedUnimplementedChoreServer() {}
func (UnimplementedChoreServer) testEmbeddedByValue() {}
@@ -206,6 +224,24 @@ func _Chore_Regions_Handler(srv interface{}, ctx context.Context, dec func(inter
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 {
return nil, err
}
if interceptor == nil {
return srv.(ChoreServer).RegionsByIds(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Chore_RegionsByIds_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChoreServer).RegionsByIds(ctx, req.(*RegionsByIdsReq))
}
return interceptor(ctx, in, info, handler)
}
// Chore_ServiceDesc is the grpc.ServiceDesc for Chore service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -229,6 +265,10 @@ var Chore_ServiceDesc = grpc.ServiceDesc{
MethodName: "Regions",
Handler: _Chore_Regions_Handler,
},
{
MethodName: "RegionsByIds",
Handler: _Chore_RegionsByIds_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "chore/chore.proto",