328 lines
12 KiB
Go
328 lines
12 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
// versions:
|
||
// - protoc-gen-go-grpc v1.5.1
|
||
// - protoc (unknown)
|
||
// source: account.proto
|
||
|
||
package passport
|
||
|
||
import (
|
||
context "context"
|
||
grpc "google.golang.org/grpc"
|
||
codes "google.golang.org/grpc/codes"
|
||
status "google.golang.org/grpc/status"
|
||
)
|
||
|
||
// This is a compile-time assertion to ensure that this generated file
|
||
// is compatible with the grpc package it is being compiled against.
|
||
// Requires gRPC-Go v1.64.0 or later.
|
||
const _ = grpc.SupportPackageIsVersion9
|
||
|
||
const (
|
||
Account_Get_FullMethodName = "/passport.Account/Get"
|
||
Account_SetData_FullMethodName = "/passport.Account/SetData"
|
||
Account_SetPassword_FullMethodName = "/passport.Account/SetPassword"
|
||
Account_TagCreate_FullMethodName = "/passport.Account/TagCreate"
|
||
Account_TagRemove_FullMethodName = "/passport.Account/TagRemove"
|
||
Account_Statistics_FullMethodName = "/passport.Account/Statistics"
|
||
)
|
||
|
||
// AccountClient is the client API for Account service.
|
||
//
|
||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||
//
|
||
// Passport(会员通行证)模块-数据
|
||
type AccountClient interface {
|
||
// 通过会员所有信息
|
||
Get(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetFullReply, error)
|
||
// 更新会员的信息数据,字段值为空或是0,将不更新此数据
|
||
SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||
// 更新会员的密码
|
||
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||
// 新增标签
|
||
TagCreate(ctx context.Context, in *TagItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||
// 删除标签
|
||
TagRemove(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||
// 获取会员的相关统计数据
|
||
Statistics(ctx context.Context, in *StatisticsRequest, opts ...grpc.CallOption) (*StatisticsReply, error)
|
||
}
|
||
|
||
type accountClient struct {
|
||
cc grpc.ClientConnInterface
|
||
}
|
||
|
||
func NewAccountClient(cc grpc.ClientConnInterface) AccountClient {
|
||
return &accountClient{cc}
|
||
}
|
||
|
||
func (c *accountClient) Get(ctx context.Context, in *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...)
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
func (c *accountClient) SetData(ctx context.Context, in *SetDataRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
out := new(StatusReply)
|
||
err := c.cc.Invoke(ctx, Account_SetData_FullMethodName, in, out, cOpts...)
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
func (c *accountClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
out := new(StatusReply)
|
||
err := c.cc.Invoke(ctx, Account_SetPassword_FullMethodName, in, out, cOpts...)
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
func (c *accountClient) TagCreate(ctx context.Context, in *TagItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
out := new(StatusReply)
|
||
err := c.cc.Invoke(ctx, Account_TagCreate_FullMethodName, in, out, cOpts...)
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
func (c *accountClient) TagRemove(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
out := new(StatusReply)
|
||
err := c.cc.Invoke(ctx, Account_TagRemove_FullMethodName, in, out, cOpts...)
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
func (c *accountClient) Statistics(ctx context.Context, in *StatisticsRequest, opts ...grpc.CallOption) (*StatisticsReply, error) {
|
||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
out := new(StatisticsReply)
|
||
err := c.cc.Invoke(ctx, Account_Statistics_FullMethodName, in, out, cOpts...)
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
// AccountServer is the server API for Account service.
|
||
// All implementations must embed UnimplementedAccountServer
|
||
// for forward compatibility.
|
||
//
|
||
// Passport(会员通行证)模块-数据
|
||
type AccountServer interface {
|
||
// 通过会员所有信息
|
||
Get(context.Context, *Empty) (*GetFullReply, error)
|
||
// 更新会员的信息数据,字段值为空或是0,将不更新此数据
|
||
SetData(context.Context, *SetDataRequest) (*StatusReply, error)
|
||
// 更新会员的密码
|
||
SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error)
|
||
// 新增标签
|
||
TagCreate(context.Context, *TagItem) (*StatusReply, error)
|
||
// 删除标签
|
||
TagRemove(context.Context, *IdentRequest) (*StatusReply, error)
|
||
// 获取会员的相关统计数据
|
||
Statistics(context.Context, *StatisticsRequest) (*StatisticsReply, error)
|
||
mustEmbedUnimplementedAccountServer()
|
||
}
|
||
|
||
// UnimplementedAccountServer must 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) {
|
||
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||
}
|
||
func (UnimplementedAccountServer) SetData(context.Context, *SetDataRequest) (*StatusReply, error) {
|
||
return nil, status.Errorf(codes.Unimplemented, "method SetData not implemented")
|
||
}
|
||
func (UnimplementedAccountServer) SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error) {
|
||
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
|
||
}
|
||
func (UnimplementedAccountServer) TagCreate(context.Context, *TagItem) (*StatusReply, error) {
|
||
return nil, status.Errorf(codes.Unimplemented, "method TagCreate not implemented")
|
||
}
|
||
func (UnimplementedAccountServer) TagRemove(context.Context, *IdentRequest) (*StatusReply, error) {
|
||
return nil, status.Errorf(codes.Unimplemented, "method TagRemove not implemented")
|
||
}
|
||
func (UnimplementedAccountServer) Statistics(context.Context, *StatisticsRequest) (*StatisticsReply, error) {
|
||
return nil, status.Errorf(codes.Unimplemented, "method Statistics not implemented")
|
||
}
|
||
func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
|
||
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
|
||
// result in compilation errors.
|
||
type UnsafeAccountServer interface {
|
||
mustEmbedUnimplementedAccountServer()
|
||
}
|
||
|
||
func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer) {
|
||
// If the following call pancis, it indicates UnimplementedAccountServer 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.
|
||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||
t.testEmbeddedByValue()
|
||
}
|
||
s.RegisterService(&Account_ServiceDesc, srv)
|
||
}
|
||
|
||
func _Account_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
in := new(Empty)
|
||
if err := dec(in); err != nil {
|
||
return nil, err
|
||
}
|
||
if interceptor == nil {
|
||
return srv.(AccountServer).Get(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Account_Get_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(AccountServer).Get(ctx, req.(*Empty))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
func _Account_SetData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
in := new(SetDataRequest)
|
||
if err := dec(in); err != nil {
|
||
return nil, err
|
||
}
|
||
if interceptor == nil {
|
||
return srv.(AccountServer).SetData(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Account_SetData_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(AccountServer).SetData(ctx, req.(*SetDataRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
func _Account_SetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
in := new(SetPasswordRequest)
|
||
if err := dec(in); err != nil {
|
||
return nil, err
|
||
}
|
||
if interceptor == nil {
|
||
return srv.(AccountServer).SetPassword(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Account_SetPassword_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(AccountServer).SetPassword(ctx, req.(*SetPasswordRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
func _Account_TagCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
in := new(TagItem)
|
||
if err := dec(in); err != nil {
|
||
return nil, err
|
||
}
|
||
if interceptor == nil {
|
||
return srv.(AccountServer).TagCreate(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Account_TagCreate_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(AccountServer).TagCreate(ctx, req.(*TagItem))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
func _Account_TagRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
in := new(IdentRequest)
|
||
if err := dec(in); err != nil {
|
||
return nil, err
|
||
}
|
||
if interceptor == nil {
|
||
return srv.(AccountServer).TagRemove(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Account_TagRemove_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(AccountServer).TagRemove(ctx, req.(*IdentRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
func _Account_Statistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
in := new(StatisticsRequest)
|
||
if err := dec(in); err != nil {
|
||
return nil, err
|
||
}
|
||
if interceptor == nil {
|
||
return srv.(AccountServer).Statistics(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Account_Statistics_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(AccountServer).Statistics(ctx, req.(*StatisticsRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
// Account_ServiceDesc is the grpc.ServiceDesc for Account service.
|
||
// It's only intended for direct use with grpc.RegisterService,
|
||
// and not to be introspected or modified (even as a copy)
|
||
var Account_ServiceDesc = grpc.ServiceDesc{
|
||
ServiceName: "passport.Account",
|
||
HandlerType: (*AccountServer)(nil),
|
||
Methods: []grpc.MethodDesc{
|
||
{
|
||
MethodName: "Get",
|
||
Handler: _Account_Get_Handler,
|
||
},
|
||
{
|
||
MethodName: "SetData",
|
||
Handler: _Account_SetData_Handler,
|
||
},
|
||
{
|
||
MethodName: "SetPassword",
|
||
Handler: _Account_SetPassword_Handler,
|
||
},
|
||
{
|
||
MethodName: "TagCreate",
|
||
Handler: _Account_TagCreate_Handler,
|
||
},
|
||
{
|
||
MethodName: "TagRemove",
|
||
Handler: _Account_TagRemove_Handler,
|
||
},
|
||
{
|
||
MethodName: "Statistics",
|
||
Handler: _Account_Statistics_Handler,
|
||
},
|
||
},
|
||
Streams: []grpc.StreamDesc{},
|
||
Metadata: "account.proto",
|
||
}
|