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.6.1
|
||||
// - protoc (unknown)
|
||||
// source: account.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/base/passport/proto/account.proto
|
||||
|
||||
package passport
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -34,15 +35,15 @@ const (
|
||||
// assport通行证模块-帐号数据
|
||||
type AccountClient interface {
|
||||
// 通过会员所有信息
|
||||
Get(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetFullReply, error)
|
||||
Get(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*GetFullReply, error)
|
||||
// 更新会员的信息数据,字段值为空或是0,将不更新此数据
|
||||
SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
// 更新会员的密码
|
||||
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
// 新增标签
|
||||
TagCreate(ctx context.Context, in *TagItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
TagCreate(ctx context.Context, in *TagItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
// 删除标签
|
||||
TagRemove(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
TagRemove(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
// 获取会员的相关统计数据
|
||||
Statistics(ctx context.Context, in *StatisticsRequest, opts ...grpc.CallOption) (*StatisticsReply, error)
|
||||
}
|
||||
@@ -55,7 +56,7 @@ func NewAccountClient(cc grpc.ClientConnInterface) AccountClient {
|
||||
return &accountClient{cc}
|
||||
}
|
||||
|
||||
func (c *accountClient) Get(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetFullReply, error) {
|
||||
func (c *accountClient) Get(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*GetFullReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetFullReply)
|
||||
err := c.cc.Invoke(ctx, Account_Get_FullMethodName, in, out, cOpts...)
|
||||
@@ -65,9 +66,9 @@ func (c *accountClient) Get(ctx context.Context, in *Empty, opts ...grpc.CallOpt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountClient) SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *accountClient) SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.StatusReply)
|
||||
err := c.cc.Invoke(ctx, Account_SetData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -75,9 +76,9 @@ func (c *accountClient) SetData(ctx context.Context, in *SetDataRequest, opts ..
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *accountClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.StatusReply)
|
||||
err := c.cc.Invoke(ctx, Account_SetPassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -85,9 +86,9 @@ func (c *accountClient) SetPassword(ctx context.Context, in *SetPasswordRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountClient) TagCreate(ctx context.Context, in *TagItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *accountClient) TagCreate(ctx context.Context, in *TagItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.StatusReply)
|
||||
err := c.cc.Invoke(ctx, Account_TagCreate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -95,9 +96,9 @@ func (c *accountClient) TagCreate(ctx context.Context, in *TagItem, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountClient) TagRemove(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *accountClient) TagRemove(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.StatusReply)
|
||||
err := c.cc.Invoke(ctx, Account_TagRemove_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -116,53 +117,51 @@ func (c *accountClient) Statistics(ctx context.Context, in *StatisticsRequest, o
|
||||
}
|
||||
|
||||
// AccountServer is the server API for Account service.
|
||||
// All implementations must embed UnimplementedAccountServer
|
||||
// All implementations should embed UnimplementedAccountServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// assport通行证模块-帐号数据
|
||||
type AccountServer interface {
|
||||
// 通过会员所有信息
|
||||
Get(context.Context, *Empty) (*GetFullReply, error)
|
||||
Get(context.Context, *protobuf.Empty) (*GetFullReply, error)
|
||||
// 更新会员的信息数据,字段值为空或是0,将不更新此数据
|
||||
SetData(context.Context, *SetDataRequest) (*StatusReply, error)
|
||||
SetData(context.Context, *SetDataRequest) (*protobuf.StatusReply, error)
|
||||
// 更新会员的密码
|
||||
SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error)
|
||||
SetPassword(context.Context, *SetPasswordRequest) (*protobuf.StatusReply, error)
|
||||
// 新增标签
|
||||
TagCreate(context.Context, *TagItem) (*StatusReply, error)
|
||||
TagCreate(context.Context, *TagItem) (*protobuf.StatusReply, error)
|
||||
// 删除标签
|
||||
TagRemove(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
TagRemove(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
// 获取会员的相关统计数据
|
||||
Statistics(context.Context, *StatisticsRequest) (*StatisticsReply, error)
|
||||
mustEmbedUnimplementedAccountServer()
|
||||
}
|
||||
|
||||
// UnimplementedAccountServer must be embedded to have
|
||||
// UnimplementedAccountServer 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 UnimplementedAccountServer struct{}
|
||||
|
||||
func (UnimplementedAccountServer) Get(context.Context, *Empty) (*GetFullReply, error) {
|
||||
func (UnimplementedAccountServer) Get(context.Context, *protobuf.Empty) (*GetFullReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServer) SetData(context.Context, *SetDataRequest) (*StatusReply, error) {
|
||||
func (UnimplementedAccountServer) SetData(context.Context, *SetDataRequest) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetData not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServer) SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error) {
|
||||
func (UnimplementedAccountServer) SetPassword(context.Context, *SetPasswordRequest) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPassword not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServer) TagCreate(context.Context, *TagItem) (*StatusReply, error) {
|
||||
func (UnimplementedAccountServer) TagCreate(context.Context, *TagItem) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method TagCreate not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServer) TagRemove(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
func (UnimplementedAccountServer) TagRemove(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method TagRemove not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServer) Statistics(context.Context, *StatisticsRequest) (*StatisticsReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Statistics not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
|
||||
func (UnimplementedAccountServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedAccountServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAccountServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AccountServer will
|
||||
@@ -183,7 +182,7 @@ func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer) {
|
||||
}
|
||||
|
||||
func _Account_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
in := new(protobuf.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -195,7 +194,7 @@ func _Account_Get_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Account_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServer).Get(ctx, req.(*Empty))
|
||||
return srv.(AccountServer).Get(ctx, req.(*protobuf.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -255,7 +254,7 @@ func _Account_TagCreate_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Account_TagRemove_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
|
||||
}
|
||||
@@ -267,7 +266,7 @@ func _Account_TagRemove_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
FullMethod: Account_TagRemove_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServer).TagRemove(ctx, req.(*IdentRequest))
|
||||
return srv.(AccountServer).TagRemove(ctx, req.(*protobuf.IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -323,5 +322,5 @@ var Account_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "account.proto",
|
||||
Metadata: "module/base/passport/proto/account.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user