refactor: centralize protobuf and remove go-zero
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: agency.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/ec/market/proto/agency.proto
|
||||
|
||||
package market
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -37,23 +38,23 @@ const (
|
||||
// 营销服务 - 代理商
|
||||
type AgencyClient interface {
|
||||
// 登录
|
||||
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error)
|
||||
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error)
|
||||
// 新增代理商
|
||||
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
// 获取一个代理商
|
||||
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
|
||||
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
|
||||
// 代理商列表
|
||||
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
// 更新代理商数据
|
||||
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
// 删除一个代理商
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
// 更新密码
|
||||
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
//待审核
|
||||
Pending(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
// 待审核
|
||||
Pending(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
|
||||
// 审核
|
||||
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
type agencyClient struct {
|
||||
@@ -64,9 +65,9 @@ func NewAgencyClient(cc grpc.ClientConnInterface) AgencyClient {
|
||||
return &agencyClient{cc}
|
||||
}
|
||||
|
||||
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) {
|
||||
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*protobuf.MarketLoginReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LoginReply)
|
||||
out := new(protobuf.MarketLoginReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Login_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -74,9 +75,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) (*StatusReply, error) {
|
||||
func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,7 +85,7 @@ func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error) {
|
||||
func (c *agencyClient) Get(ctx context.Context, in *protobuf.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...)
|
||||
@@ -94,7 +95,7 @@ func (c *agencyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.C
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
|
||||
func (c *agencyClient) Fetch(ctx context.Context, in *protobuf.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...)
|
||||
@@ -104,9 +105,9 @@ func (c *agencyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -114,9 +115,9 @@ func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *agencyClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -124,9 +125,9 @@ func (c *agencyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_SetPassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -134,7 +135,7 @@ func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Pending(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
|
||||
func (c *agencyClient) Pending(ctx context.Context, in *protobuf.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...)
|
||||
@@ -144,9 +145,9 @@ func (c *agencyClient) Pending(ctx context.Context, in *FetchRequest, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Agency_Approve_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -155,68 +156,66 @@ func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...
|
||||
}
|
||||
|
||||
// AgencyServer is the server API for Agency service.
|
||||
// All implementations must embed UnimplementedAgencyServer
|
||||
// All implementations should embed UnimplementedAgencyServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 营销服务 - 代理商
|
||||
type AgencyServer interface {
|
||||
// 登录
|
||||
Login(context.Context, *LoginRequest) (*LoginReply, error)
|
||||
Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error)
|
||||
// 新增代理商
|
||||
Create(context.Context, *MarketAgenctyItem) (*StatusReply, error)
|
||||
Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
|
||||
// 获取一个代理商
|
||||
Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error)
|
||||
Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error)
|
||||
// 代理商列表
|
||||
Fetch(context.Context, *FetchRequest) (*AgencyReply, error)
|
||||
Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
|
||||
// 更新代理商数据
|
||||
Modify(context.Context, *MarketAgenctyItem) (*StatusReply, error)
|
||||
Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error)
|
||||
// 删除一个代理商
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
|
||||
// 更新密码
|
||||
SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error)
|
||||
//待审核
|
||||
Pending(context.Context, *FetchRequest) (*AgencyReply, error)
|
||||
SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error)
|
||||
// 待审核
|
||||
Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error)
|
||||
// 审核
|
||||
Approve(context.Context, *ApproveRequest) (*StatusReply, error)
|
||||
mustEmbedUnimplementedAgencyServer()
|
||||
Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedAgencyServer must be embedded to have
|
||||
// UnimplementedAgencyServer should be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAgencyServer struct{}
|
||||
|
||||
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*LoginReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
||||
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*protobuf.MarketLoginReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||
func (UnimplementedAgencyServer) Get(context.Context, *protobuf.IdentRequest) (*MarketAgenctyItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Fetch(context.Context, *FetchRequest) (*AgencyReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
|
||||
func (UnimplementedAgencyServer) Fetch(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
|
||||
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||
func (UnimplementedAgencyServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
|
||||
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPassword not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Pending(context.Context, *FetchRequest) (*AgencyReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Pending not implemented")
|
||||
func (UnimplementedAgencyServer) Pending(context.Context, *protobuf.MarketFetchRequest) (*AgencyReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Pending not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Approve not implemented")
|
||||
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Approve not implemented")
|
||||
}
|
||||
func (UnimplementedAgencyServer) mustEmbedUnimplementedAgencyServer() {}
|
||||
func (UnimplementedAgencyServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedAgencyServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAgencyServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AgencyServer will
|
||||
@@ -226,7 +225,7 @@ type UnsafeAgencyServer interface {
|
||||
}
|
||||
|
||||
func RegisterAgencyServer(s grpc.ServiceRegistrar, srv AgencyServer) {
|
||||
// If the following call pancis, it indicates UnimplementedAgencyServer was
|
||||
// If the following call panics, it indicates UnimplementedAgencyServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
@@ -273,7 +272,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(IdentRequest)
|
||||
in := new(protobuf.IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -285,13 +284,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.(*IdentRequest))
|
||||
return srv.(AgencyServer).Get(ctx, req.(*protobuf.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(FetchRequest)
|
||||
in := new(protobuf.MarketFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -303,7 +302,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.(*FetchRequest))
|
||||
return srv.(AgencyServer).Fetch(ctx, req.(*protobuf.MarketFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -327,7 +326,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(IdentRequest)
|
||||
in := new(protobuf.IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -339,7 +338,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.(*IdentRequest))
|
||||
return srv.(AgencyServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -363,7 +362,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(FetchRequest)
|
||||
in := new(protobuf.MarketFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -375,7 +374,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.(*FetchRequest))
|
||||
return srv.(AgencyServer).Pending(ctx, req.(*protobuf.MarketFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -443,5 +442,5 @@ var Agency_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "agency.proto",
|
||||
Metadata: "module/ec/market/proto/agency.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user