feat: sale manager
This commit is contained in:
Binary file not shown.
@@ -17,6 +17,16 @@ service Chore {
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc DecryptMobile(DecryptMobileReq) returns (Response) {
|
||||
option (google.api.http) = {
|
||||
get: "/api/v3/chore/decrypt/mobile"
|
||||
};
|
||||
}
|
||||
rpc Regions(RegionsReq) returns (Response) {
|
||||
option (google.api.http) = {
|
||||
get: "/api/v3/chore/regions"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message Response {
|
||||
@@ -33,4 +43,12 @@ message TestReq {
|
||||
int32 id = 1;
|
||||
repeated int64 ids = 2;
|
||||
uint32 number = 3;
|
||||
}
|
||||
|
||||
message DecryptMobileReq {
|
||||
string origin_mobile = 1;
|
||||
}
|
||||
|
||||
message RegionsReq {
|
||||
int32 parent_id = 1;
|
||||
}
|
||||
+112
-11
@@ -186,6 +186,94 @@ func (x *TestReq) GetNumber() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
type DecryptMobileReq struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
OriginMobile string `protobuf:"bytes,1,opt,name=origin_mobile,json=originMobile,proto3" json:"origin_mobile,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DecryptMobileReq) Reset() {
|
||||
*x = DecryptMobileReq{}
|
||||
mi := &file_chore_chore_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DecryptMobileReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DecryptMobileReq) ProtoMessage() {}
|
||||
|
||||
func (x *DecryptMobileReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_chore_chore_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DecryptMobileReq.ProtoReflect.Descriptor instead.
|
||||
func (*DecryptMobileReq) Descriptor() ([]byte, []int) {
|
||||
return file_chore_chore_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *DecryptMobileReq) GetOriginMobile() string {
|
||||
if x != nil {
|
||||
return x.OriginMobile
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RegionsReq struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ParentId int32 `protobuf:"varint,1,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RegionsReq) Reset() {
|
||||
*x = RegionsReq{}
|
||||
mi := &file_chore_chore_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RegionsReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegionsReq) ProtoMessage() {}
|
||||
|
||||
func (x *RegionsReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_chore_chore_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegionsReq.ProtoReflect.Descriptor instead.
|
||||
func (*RegionsReq) Descriptor() ([]byte, []int) {
|
||||
return file_chore_chore_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *RegionsReq) GetParentId() int32 {
|
||||
if x != nil {
|
||||
return x.ParentId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_chore_chore_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_chore_chore_proto_rawDesc = "" +
|
||||
@@ -200,10 +288,17 @@ const file_chore_chore_proto_rawDesc = "" +
|
||||
"\aTestReq\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x10\n" +
|
||||
"\x03ids\x18\x02 \x03(\x03R\x03ids\x12\x16\n" +
|
||||
"\x06number\x18\x03 \x01(\rR\x06number2\xa1\x01\n" +
|
||||
"\x06number\x18\x03 \x01(\rR\x06number\"7\n" +
|
||||
"\x10DecryptMobileReq\x12#\n" +
|
||||
"\rorigin_mobile\x18\x01 \x01(\tR\foriginMobile\")\n" +
|
||||
"\n" +
|
||||
"RegionsReq\x12\x1b\n" +
|
||||
"\tparent_id\x18\x01 \x01(\x05R\bparentId2\xd0\x02\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/testB\x19Z\x17lone-services/rpc/choreb\x06proto3"
|
||||
"\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"
|
||||
|
||||
var (
|
||||
file_chore_chore_proto_rawDescOnce sync.Once
|
||||
@@ -217,19 +312,25 @@ func file_chore_chore_proto_rawDescGZIP() []byte {
|
||||
return file_chore_chore_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_chore_chore_proto_goTypes = []any{
|
||||
(*Response)(nil), // 0: chore.Response
|
||||
(*PolicyReq)(nil), // 1: chore.PolicyReq
|
||||
(*TestReq)(nil), // 2: chore.TestReq
|
||||
(*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
|
||||
}
|
||||
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
|
||||
0, // 2: chore.Chore.Policy:output_type -> chore.Response
|
||||
0, // 3: chore.Chore.Test:output_type -> chore.Response
|
||||
2, // [2:4] is the sub-list for method output_type
|
||||
0, // [0:2] is the sub-list for method input_type
|
||||
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
|
||||
@@ -246,7 +347,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: 3,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@@ -19,8 +19,10 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Chore_Policy_FullMethodName = "/chore.Chore/Policy"
|
||||
Chore_Test_FullMethodName = "/chore.Chore/Test"
|
||||
Chore_Policy_FullMethodName = "/chore.Chore/Policy"
|
||||
Chore_Test_FullMethodName = "/chore.Chore/Test"
|
||||
Chore_DecryptMobile_FullMethodName = "/chore.Chore/DecryptMobile"
|
||||
Chore_Regions_FullMethodName = "/chore.Chore/Regions"
|
||||
)
|
||||
|
||||
// ChoreClient is the client API for Chore service.
|
||||
@@ -29,6 +31,8 @@ const (
|
||||
type ChoreClient interface {
|
||||
Policy(ctx context.Context, in *PolicyReq, opts ...grpc.CallOption) (*Response, error)
|
||||
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)
|
||||
}
|
||||
|
||||
type choreClient struct {
|
||||
@@ -59,12 +63,34 @@ func (c *choreClient) Test(ctx context.Context, in *TestReq, opts ...grpc.CallOp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *choreClient) DecryptMobile(ctx context.Context, in *DecryptMobileReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Chore_DecryptMobile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *choreClient) Regions(ctx context.Context, in *RegionsReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Chore_Regions_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.
|
||||
type ChoreServer interface {
|
||||
Policy(context.Context, *PolicyReq) (*Response, error)
|
||||
Test(context.Context, *TestReq) (*Response, error)
|
||||
DecryptMobile(context.Context, *DecryptMobileReq) (*Response, error)
|
||||
Regions(context.Context, *RegionsReq) (*Response, error)
|
||||
mustEmbedUnimplementedChoreServer()
|
||||
}
|
||||
|
||||
@@ -81,6 +107,12 @@ func (UnimplementedChoreServer) Policy(context.Context, *PolicyReq) (*Response,
|
||||
func (UnimplementedChoreServer) Test(context.Context, *TestReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Test not implemented")
|
||||
}
|
||||
func (UnimplementedChoreServer) DecryptMobile(context.Context, *DecryptMobileReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DecryptMobile not implemented")
|
||||
}
|
||||
func (UnimplementedChoreServer) Regions(context.Context, *RegionsReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Regions not implemented")
|
||||
}
|
||||
func (UnimplementedChoreServer) mustEmbedUnimplementedChoreServer() {}
|
||||
func (UnimplementedChoreServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -138,6 +170,42 @@ func _Chore_Test_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Chore_DecryptMobile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DecryptMobileReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ChoreServer).DecryptMobile(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Chore_DecryptMobile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ChoreServer).DecryptMobile(ctx, req.(*DecryptMobileReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Chore_Regions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegionsReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ChoreServer).Regions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Chore_Regions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ChoreServer).Regions(ctx, req.(*RegionsReq))
|
||||
}
|
||||
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)
|
||||
@@ -153,6 +221,14 @@ var Chore_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Test",
|
||||
Handler: _Chore_Test_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DecryptMobile",
|
||||
Handler: _Chore_DecryptMobile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Regions",
|
||||
Handler: _Chore_Regions_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "chore/chore.proto",
|
||||
|
||||
Reference in New Issue
Block a user