refactor: localize protobuf definitions
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -38,23 +37,23 @@ const (
|
||||
// 营销服务 - 代理商
|
||||
type AgencyClient interface {
|
||||
// 登录
|
||||
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error)
|
||||
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*MarketLoginReply, error)
|
||||
// 新增代理商
|
||||
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 获取一个代理商
|
||||
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
|
||||
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
|
||||
// 代理商列表
|
||||
Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
Fetch(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
// 更新代理商数据
|
||||
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 删除一个代理商
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 更新密码
|
||||
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 待审核
|
||||
Pending(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
Pending(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
// 审核
|
||||
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
type agencyClient struct {
|
||||
@@ -65,9 +64,9 @@ func NewAgencyClient(cc grpc.ClientConnInterface) AgencyClient {
|
||||
return &agencyClient{cc}
|
||||
}
|
||||
|
||||
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error) {
|
||||
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*MarketLoginReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.MarketLoginReply)
|
||||
out := new(MarketLoginReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Login_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -75,9 +74,9 @@ func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -85,7 +84,7 @@ func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error) {
|
||||
func (c *agencyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MarketAgenctyItem)
|
||||
err := c.cc.Invoke(ctx, Agency_Get_FullMethodName, in, out, cOpts...)
|
||||
@@ -95,7 +94,7 @@ func (c *agencyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
|
||||
func (c *agencyClient) Fetch(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AgencyReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -105,9 +104,9 @@ func (c *agencyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -115,9 +114,9 @@ func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *agencyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -125,9 +124,9 @@ func (c *agencyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, op
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_SetPassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -135,7 +134,7 @@ func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Pending(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
|
||||
func (c *agencyClient) Pending(ctx context.Context, in *MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AgencyReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Pending_FullMethodName, in, out, cOpts...)
|
||||
@@ -145,9 +144,9 @@ func (c *agencyClient) Pending(ctx context.Context, in *protobuf.MarketFetchRequ
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Approve_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -162,23 +161,23 @@ func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...
|
||||
// 营销服务 - 代理商
|
||||
type AgencyServer interface {
|
||||
// 登录
|
||||
Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error)
|
||||
Login(context.Context, *LoginRequest) (*MarketLoginReply, error)
|
||||
// 新增代理商
|
||||
Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
|
||||
Create(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error)
|
||||
// 获取一个代理商
|
||||
Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error)
|
||||
Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error)
|
||||
// 代理商列表
|
||||
Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
|
||||
Fetch(context.Context, *MarketFetchRequest) (*AgencyReply, error)
|
||||
// 更新代理商数据
|
||||
Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
|
||||
Modify(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error)
|
||||
// 删除一个代理商
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
|
||||
Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
|
||||
// 更新密码
|
||||
SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error)
|
||||
SetPassword(context.Context, *SetPasswordRequest) (*IdentityStatusReply, error)
|
||||
// 待审核
|
||||
Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
|
||||
Pending(context.Context, *MarketFetchRequest) (*AgencyReply, error)
|
||||
// 审核
|
||||
Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error)
|
||||
Approve(context.Context, *ApproveRequest) (*IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedAgencyServer should be embedded to have
|
||||
@@ -188,31 +187,31 @@ type AgencyServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAgencyServer struct{}
|
||||
|
||||
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error) {
|
||||
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*MarketLoginReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error) {
|
||||
func (UnimplementedAgencyServer) Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
|
||||
func (UnimplementedAgencyServer) Fetch(context.Context, *MarketFetchRequest) (*AgencyReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedAgencyServer) Delete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPassword not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
|
||||
func (UnimplementedAgencyServer) Pending(context.Context, *MarketFetchRequest) (*AgencyReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Pending not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Approve not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) testEmbeddedByValue() {}
|
||||
@@ -272,7 +271,7 @@ func _Agency_Create_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
}
|
||||
|
||||
func _Agency_Get_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
|
||||
}
|
||||
@@ -284,13 +283,13 @@ func _Agency_Get_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
FullMethod: Agency_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AgencyServer).Get(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(AgencyServer).Get(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Agency_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.MarketFetchRequest)
|
||||
in := new(MarketFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -302,7 +301,7 @@ func _Agency_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Agency_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AgencyServer).Fetch(ctx, req.(*protobuf.MarketFetchRequest))
|
||||
return srv.(AgencyServer).Fetch(ctx, req.(*MarketFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -326,7 +325,7 @@ func _Agency_Modify_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
}
|
||||
|
||||
func _Agency_Delete_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
|
||||
}
|
||||
@@ -338,7 +337,7 @@ func _Agency_Delete_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
FullMethod: Agency_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AgencyServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(AgencyServer).Delete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -362,7 +361,7 @@ func _Agency_SetPassword_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
}
|
||||
|
||||
func _Agency_Pending_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.MarketFetchRequest)
|
||||
in := new(MarketFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -374,7 +373,7 @@ func _Agency_Pending_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Agency_Pending_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AgencyServer).Pending(ctx, req.(*protobuf.MarketFetchRequest))
|
||||
return srv.(AgencyServer).Pending(ctx, req.(*MarketFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user