refactor: localize protobuf definitions
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
package mall
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -39,21 +38,21 @@ const (
|
||||
// Store(店铺)微服务-店铺基础服务
|
||||
type StoreClient interface {
|
||||
// 申请加入店铺
|
||||
ApplyJoin(ctx context.Context, in *ApplyJoinRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
ApplyJoin(ctx context.Context, in *ApplyJoinRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 店铺许可授权
|
||||
Licensing(ctx context.Context, in *LicensingRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
Licensing(ctx context.Context, in *LicensingRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 获取店铺基础配置
|
||||
GetSetting(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*StoreBasic, error)
|
||||
GetSetting(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StoreBasic, error)
|
||||
// 设置店铺基础配置
|
||||
SetSetting(ctx context.Context, in *StoreBasic, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
SetSetting(ctx context.Context, in *StoreBasic, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 设置支付方式配置
|
||||
SetPayment(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
SetPayment(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 设置邮件服务器配置
|
||||
SetEmail(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
SetEmail(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 获取支付方式配置
|
||||
GetPayment(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error)
|
||||
GetPayment(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error)
|
||||
// 获取邮件服务器配置
|
||||
GetEmail(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error)
|
||||
GetEmail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error)
|
||||
// 获取小程序推荐码
|
||||
MiniCode(ctx context.Context, in *MiniCodeRequest, opts ...grpc.CallOption) (*MiniCodeReply, error)
|
||||
// 店铺搜索
|
||||
@@ -68,9 +67,9 @@ func NewStoreClient(cc grpc.ClientConnInterface) StoreClient {
|
||||
return &storeClient{cc}
|
||||
}
|
||||
|
||||
func (c *storeClient) ApplyJoin(ctx context.Context, in *ApplyJoinRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *storeClient) ApplyJoin(ctx context.Context, in *ApplyJoinRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Store_ApplyJoin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -78,9 +77,9 @@ func (c *storeClient) ApplyJoin(ctx context.Context, in *ApplyJoinRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *storeClient) Licensing(ctx context.Context, in *LicensingRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *storeClient) Licensing(ctx context.Context, in *LicensingRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Store_Licensing_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -88,7 +87,7 @@ func (c *storeClient) Licensing(ctx context.Context, in *LicensingRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *storeClient) GetSetting(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*StoreBasic, error) {
|
||||
func (c *storeClient) GetSetting(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StoreBasic, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StoreBasic)
|
||||
err := c.cc.Invoke(ctx, Store_GetSetting_FullMethodName, in, out, cOpts...)
|
||||
@@ -98,9 +97,9 @@ func (c *storeClient) GetSetting(ctx context.Context, in *protobuf.IdentRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *storeClient) SetSetting(ctx context.Context, in *StoreBasic, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *storeClient) SetSetting(ctx context.Context, in *StoreBasic, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Store_SetSetting_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -108,9 +107,9 @@ func (c *storeClient) SetSetting(ctx context.Context, in *StoreBasic, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *storeClient) SetPayment(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *storeClient) SetPayment(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Store_SetPayment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -118,9 +117,9 @@ func (c *storeClient) SetPayment(ctx context.Context, in *SettingRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *storeClient) SetEmail(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *storeClient) SetEmail(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Store_SetEmail_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -128,7 +127,7 @@ func (c *storeClient) SetEmail(ctx context.Context, in *SettingRequest, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *storeClient) GetPayment(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error) {
|
||||
func (c *storeClient) GetPayment(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ConfigsReply)
|
||||
err := c.cc.Invoke(ctx, Store_GetPayment_FullMethodName, in, out, cOpts...)
|
||||
@@ -138,7 +137,7 @@ func (c *storeClient) GetPayment(ctx context.Context, in *protobuf.IdentRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *storeClient) GetEmail(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error) {
|
||||
func (c *storeClient) GetEmail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*ConfigsReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ConfigsReply)
|
||||
err := c.cc.Invoke(ctx, Store_GetEmail_FullMethodName, in, out, cOpts...)
|
||||
@@ -175,21 +174,21 @@ func (c *storeClient) Search(ctx context.Context, in *MallSearchRequest, opts ..
|
||||
// Store(店铺)微服务-店铺基础服务
|
||||
type StoreServer interface {
|
||||
// 申请加入店铺
|
||||
ApplyJoin(context.Context, *ApplyJoinRequest) (*protobuf.IdentityStatusReply, error)
|
||||
ApplyJoin(context.Context, *ApplyJoinRequest) (*IdentityStatusReply, error)
|
||||
// 店铺许可授权
|
||||
Licensing(context.Context, *LicensingRequest) (*protobuf.IdentityStatusReply, error)
|
||||
Licensing(context.Context, *LicensingRequest) (*IdentityStatusReply, error)
|
||||
// 获取店铺基础配置
|
||||
GetSetting(context.Context, *protobuf.IdentRequest) (*StoreBasic, error)
|
||||
GetSetting(context.Context, *IdentRequest) (*StoreBasic, error)
|
||||
// 设置店铺基础配置
|
||||
SetSetting(context.Context, *StoreBasic) (*protobuf.IdentityStatusReply, error)
|
||||
SetSetting(context.Context, *StoreBasic) (*IdentityStatusReply, error)
|
||||
// 设置支付方式配置
|
||||
SetPayment(context.Context, *SettingRequest) (*protobuf.IdentityStatusReply, error)
|
||||
SetPayment(context.Context, *SettingRequest) (*IdentityStatusReply, error)
|
||||
// 设置邮件服务器配置
|
||||
SetEmail(context.Context, *SettingRequest) (*protobuf.IdentityStatusReply, error)
|
||||
SetEmail(context.Context, *SettingRequest) (*IdentityStatusReply, error)
|
||||
// 获取支付方式配置
|
||||
GetPayment(context.Context, *protobuf.IdentRequest) (*ConfigsReply, error)
|
||||
GetPayment(context.Context, *IdentRequest) (*ConfigsReply, error)
|
||||
// 获取邮件服务器配置
|
||||
GetEmail(context.Context, *protobuf.IdentRequest) (*ConfigsReply, error)
|
||||
GetEmail(context.Context, *IdentRequest) (*ConfigsReply, error)
|
||||
// 获取小程序推荐码
|
||||
MiniCode(context.Context, *MiniCodeRequest) (*MiniCodeReply, error)
|
||||
// 店铺搜索
|
||||
@@ -203,28 +202,28 @@ type StoreServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedStoreServer struct{}
|
||||
|
||||
func (UnimplementedStoreServer) ApplyJoin(context.Context, *ApplyJoinRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedStoreServer) ApplyJoin(context.Context, *ApplyJoinRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ApplyJoin not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) Licensing(context.Context, *LicensingRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedStoreServer) Licensing(context.Context, *LicensingRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Licensing not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) GetSetting(context.Context, *protobuf.IdentRequest) (*StoreBasic, error) {
|
||||
func (UnimplementedStoreServer) GetSetting(context.Context, *IdentRequest) (*StoreBasic, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSetting not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) SetSetting(context.Context, *StoreBasic) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedStoreServer) SetSetting(context.Context, *StoreBasic) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetSetting not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) SetPayment(context.Context, *SettingRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedStoreServer) SetPayment(context.Context, *SettingRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPayment not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) SetEmail(context.Context, *SettingRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedStoreServer) SetEmail(context.Context, *SettingRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetEmail not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) GetPayment(context.Context, *protobuf.IdentRequest) (*ConfigsReply, error) {
|
||||
func (UnimplementedStoreServer) GetPayment(context.Context, *IdentRequest) (*ConfigsReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPayment not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) GetEmail(context.Context, *protobuf.IdentRequest) (*ConfigsReply, error) {
|
||||
func (UnimplementedStoreServer) GetEmail(context.Context, *IdentRequest) (*ConfigsReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetEmail not implemented")
|
||||
}
|
||||
func (UnimplementedStoreServer) MiniCode(context.Context, *MiniCodeRequest) (*MiniCodeReply, error) {
|
||||
@@ -290,7 +289,7 @@ func _Store_Licensing_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
}
|
||||
|
||||
func _Store_GetSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -302,7 +301,7 @@ func _Store_GetSetting_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Store_GetSetting_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StoreServer).GetSetting(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(StoreServer).GetSetting(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -362,7 +361,7 @@ func _Store_SetEmail_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
}
|
||||
|
||||
func _Store_GetPayment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -374,13 +373,13 @@ func _Store_GetPayment_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Store_GetPayment_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StoreServer).GetPayment(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(StoreServer).GetPayment(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Store_GetEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -392,7 +391,7 @@ func _Store_GetEmail_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Store_GetEmail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StoreServer).GetEmail(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(StoreServer).GetEmail(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user