tianyuan-api-server/apps/user/user/user_grpc.pb.go
2024-10-15 17:19:23 +08:00

1011 lines
39 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc v3.19.4
// source: user.proto
package user
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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8
const (
Enterprise_GetPendingEnterprise_FullMethodName = "/Enterprise/GetPendingEnterprise"
Enterprise_ReviewEnterprise_FullMethodName = "/Enterprise/ReviewEnterprise"
Enterprise_CreateEnterpriseAuth_FullMethodName = "/Enterprise/CreateEnterpriseAuth"
)
// EnterpriseClient is the client API for Enterprise 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.
//
// 定义服务
type EnterpriseClient interface {
// 获取待审核企业列表
GetPendingEnterprise(ctx context.Context, in *GetPendingEnterpriseReq, opts ...grpc.CallOption) (*GetPendingEnterpriseResp, error)
// 审核企业
ReviewEnterprise(ctx context.Context, in *ReviewEnterpriseReq, opts ...grpc.CallOption) (*EmptyResponse, error)
// 提交审核
CreateEnterpriseAuth(ctx context.Context, in *EnterpriseAuthReq, opts ...grpc.CallOption) (*EmptyResponse, error)
}
type enterpriseClient struct {
cc grpc.ClientConnInterface
}
func NewEnterpriseClient(cc grpc.ClientConnInterface) EnterpriseClient {
return &enterpriseClient{cc}
}
func (c *enterpriseClient) GetPendingEnterprise(ctx context.Context, in *GetPendingEnterpriseReq, opts ...grpc.CallOption) (*GetPendingEnterpriseResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetPendingEnterpriseResp)
err := c.cc.Invoke(ctx, Enterprise_GetPendingEnterprise_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *enterpriseClient) ReviewEnterprise(ctx context.Context, in *ReviewEnterpriseReq, opts ...grpc.CallOption) (*EmptyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EmptyResponse)
err := c.cc.Invoke(ctx, Enterprise_ReviewEnterprise_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *enterpriseClient) CreateEnterpriseAuth(ctx context.Context, in *EnterpriseAuthReq, opts ...grpc.CallOption) (*EmptyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EmptyResponse)
err := c.cc.Invoke(ctx, Enterprise_CreateEnterpriseAuth_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// EnterpriseServer is the server API for Enterprise service.
// All implementations must embed UnimplementedEnterpriseServer
// for forward compatibility
//
// 定义服务
type EnterpriseServer interface {
// 获取待审核企业列表
GetPendingEnterprise(context.Context, *GetPendingEnterpriseReq) (*GetPendingEnterpriseResp, error)
// 审核企业
ReviewEnterprise(context.Context, *ReviewEnterpriseReq) (*EmptyResponse, error)
// 提交审核
CreateEnterpriseAuth(context.Context, *EnterpriseAuthReq) (*EmptyResponse, error)
mustEmbedUnimplementedEnterpriseServer()
}
// UnimplementedEnterpriseServer must be embedded to have forward compatible implementations.
type UnimplementedEnterpriseServer struct {
}
func (UnimplementedEnterpriseServer) GetPendingEnterprise(context.Context, *GetPendingEnterpriseReq) (*GetPendingEnterpriseResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPendingEnterprise not implemented")
}
func (UnimplementedEnterpriseServer) ReviewEnterprise(context.Context, *ReviewEnterpriseReq) (*EmptyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReviewEnterprise not implemented")
}
func (UnimplementedEnterpriseServer) CreateEnterpriseAuth(context.Context, *EnterpriseAuthReq) (*EmptyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateEnterpriseAuth not implemented")
}
func (UnimplementedEnterpriseServer) mustEmbedUnimplementedEnterpriseServer() {}
// UnsafeEnterpriseServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to EnterpriseServer will
// result in compilation errors.
type UnsafeEnterpriseServer interface {
mustEmbedUnimplementedEnterpriseServer()
}
func RegisterEnterpriseServer(s grpc.ServiceRegistrar, srv EnterpriseServer) {
s.RegisterService(&Enterprise_ServiceDesc, srv)
}
func _Enterprise_GetPendingEnterprise_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPendingEnterpriseReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EnterpriseServer).GetPendingEnterprise(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Enterprise_GetPendingEnterprise_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnterpriseServer).GetPendingEnterprise(ctx, req.(*GetPendingEnterpriseReq))
}
return interceptor(ctx, in, info, handler)
}
func _Enterprise_ReviewEnterprise_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReviewEnterpriseReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EnterpriseServer).ReviewEnterprise(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Enterprise_ReviewEnterprise_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnterpriseServer).ReviewEnterprise(ctx, req.(*ReviewEnterpriseReq))
}
return interceptor(ctx, in, info, handler)
}
func _Enterprise_CreateEnterpriseAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EnterpriseAuthReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EnterpriseServer).CreateEnterpriseAuth(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Enterprise_CreateEnterpriseAuth_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnterpriseServer).CreateEnterpriseAuth(ctx, req.(*EnterpriseAuthReq))
}
return interceptor(ctx, in, info, handler)
}
// Enterprise_ServiceDesc is the grpc.ServiceDesc for Enterprise service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Enterprise_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Enterprise",
HandlerType: (*EnterpriseServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetPendingEnterprise",
Handler: _Enterprise_GetPendingEnterprise_Handler,
},
{
MethodName: "ReviewEnterprise",
Handler: _Enterprise_ReviewEnterprise_Handler,
},
{
MethodName: "CreateEnterpriseAuth",
Handler: _Enterprise_CreateEnterpriseAuth_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
}
const (
Auth_RegisterUser_FullMethodName = "/Auth/RegisterUser"
Auth_LoginUser_FullMethodName = "/Auth/LoginUser"
Auth_PhoneLoginUser_FullMethodName = "/Auth/PhoneLoginUser"
)
// AuthClient is the client API for Auth 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.
//
// 定义认证服务
type AuthClient interface {
// 注册接口
RegisterUser(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*EmptyResponse, error)
// 登录接口
LoginUser(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error)
// 手机登录接口
PhoneLoginUser(ctx context.Context, in *PhoneLoginReq, opts ...grpc.CallOption) (*LoginResp, error)
}
type authClient struct {
cc grpc.ClientConnInterface
}
func NewAuthClient(cc grpc.ClientConnInterface) AuthClient {
return &authClient{cc}
}
func (c *authClient) RegisterUser(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*EmptyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EmptyResponse)
err := c.cc.Invoke(ctx, Auth_RegisterUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authClient) LoginUser(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LoginResp)
err := c.cc.Invoke(ctx, Auth_LoginUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authClient) PhoneLoginUser(ctx context.Context, in *PhoneLoginReq, opts ...grpc.CallOption) (*LoginResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LoginResp)
err := c.cc.Invoke(ctx, Auth_PhoneLoginUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthServer is the server API for Auth service.
// All implementations must embed UnimplementedAuthServer
// for forward compatibility
//
// 定义认证服务
type AuthServer interface {
// 注册接口
RegisterUser(context.Context, *RegisterReq) (*EmptyResponse, error)
// 登录接口
LoginUser(context.Context, *LoginReq) (*LoginResp, error)
// 手机登录接口
PhoneLoginUser(context.Context, *PhoneLoginReq) (*LoginResp, error)
mustEmbedUnimplementedAuthServer()
}
// UnimplementedAuthServer must be embedded to have forward compatible implementations.
type UnimplementedAuthServer struct {
}
func (UnimplementedAuthServer) RegisterUser(context.Context, *RegisterReq) (*EmptyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterUser not implemented")
}
func (UnimplementedAuthServer) LoginUser(context.Context, *LoginReq) (*LoginResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method LoginUser not implemented")
}
func (UnimplementedAuthServer) PhoneLoginUser(context.Context, *PhoneLoginReq) (*LoginResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method PhoneLoginUser not implemented")
}
func (UnimplementedAuthServer) mustEmbedUnimplementedAuthServer() {}
// UnsafeAuthServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthServer will
// result in compilation errors.
type UnsafeAuthServer interface {
mustEmbedUnimplementedAuthServer()
}
func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer) {
s.RegisterService(&Auth_ServiceDesc, srv)
}
func _Auth_RegisterUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServer).RegisterUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Auth_RegisterUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServer).RegisterUser(ctx, req.(*RegisterReq))
}
return interceptor(ctx, in, info, handler)
}
func _Auth_LoginUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServer).LoginUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Auth_LoginUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServer).LoginUser(ctx, req.(*LoginReq))
}
return interceptor(ctx, in, info, handler)
}
func _Auth_PhoneLoginUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PhoneLoginReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServer).PhoneLoginUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Auth_PhoneLoginUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServer).PhoneLoginUser(ctx, req.(*PhoneLoginReq))
}
return interceptor(ctx, in, info, handler)
}
// Auth_ServiceDesc is the grpc.ServiceDesc for Auth service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Auth_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Auth",
HandlerType: (*AuthServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RegisterUser",
Handler: _Auth_RegisterUser_Handler,
},
{
MethodName: "LoginUser",
Handler: _Auth_LoginUser_Handler,
},
{
MethodName: "PhoneLoginUser",
Handler: _Auth_PhoneLoginUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
}
const (
User_UserInfo_FullMethodName = "/User/UserInfo"
User_GetUserInfo_FullMethodName = "/User/GetUserInfo"
User_GetEnterpriseAuthStatus_FullMethodName = "/User/GetEnterpriseAuthStatus"
)
// UserClient is the client API for User 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.
type UserClient interface {
// 获取用户信息
UserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*UserInfoResp, error)
GetUserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error)
GetEnterpriseAuthStatus(ctx context.Context, in *GetEnterpriseAuthStatusReq, opts ...grpc.CallOption) (*GetEnterpriseAuthStatusResp, error)
}
type userClient struct {
cc grpc.ClientConnInterface
}
func NewUserClient(cc grpc.ClientConnInterface) UserClient {
return &userClient{cc}
}
func (c *userClient) UserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*UserInfoResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UserInfoResp)
err := c.cc.Invoke(ctx, User_UserInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) GetUserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUserInfoResp)
err := c.cc.Invoke(ctx, User_GetUserInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) GetEnterpriseAuthStatus(ctx context.Context, in *GetEnterpriseAuthStatusReq, opts ...grpc.CallOption) (*GetEnterpriseAuthStatusResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetEnterpriseAuthStatusResp)
err := c.cc.Invoke(ctx, User_GetEnterpriseAuthStatus_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServer is the server API for User service.
// All implementations must embed UnimplementedUserServer
// for forward compatibility
type UserServer interface {
// 获取用户信息
UserInfo(context.Context, *UserInfoReq) (*UserInfoResp, error)
GetUserInfo(context.Context, *UserInfoReq) (*GetUserInfoResp, error)
GetEnterpriseAuthStatus(context.Context, *GetEnterpriseAuthStatusReq) (*GetEnterpriseAuthStatusResp, error)
mustEmbedUnimplementedUserServer()
}
// UnimplementedUserServer must be embedded to have forward compatible implementations.
type UnimplementedUserServer struct {
}
func (UnimplementedUserServer) UserInfo(context.Context, *UserInfoReq) (*UserInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UserInfo not implemented")
}
func (UnimplementedUserServer) GetUserInfo(context.Context, *UserInfoReq) (*GetUserInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented")
}
func (UnimplementedUserServer) GetEnterpriseAuthStatus(context.Context, *GetEnterpriseAuthStatusReq) (*GetEnterpriseAuthStatusResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetEnterpriseAuthStatus not implemented")
}
func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
// UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServer will
// result in compilation errors.
type UnsafeUserServer interface {
mustEmbedUnimplementedUserServer()
}
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) {
s.RegisterService(&User_ServiceDesc, srv)
}
func _User_UserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UserInfoReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).UserInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: User_UserInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).UserInfo(ctx, req.(*UserInfoReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UserInfoReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).GetUserInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: User_GetUserInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).GetUserInfo(ctx, req.(*UserInfoReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_GetEnterpriseAuthStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetEnterpriseAuthStatusReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).GetEnterpriseAuthStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: User_GetEnterpriseAuthStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).GetEnterpriseAuthStatus(ctx, req.(*GetEnterpriseAuthStatusReq))
}
return interceptor(ctx, in, info, handler)
}
// User_ServiceDesc is the grpc.ServiceDesc for User service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var User_ServiceDesc = grpc.ServiceDesc{
ServiceName: "User",
HandlerType: (*UserServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "UserInfo",
Handler: _User_UserInfo_Handler,
},
{
MethodName: "GetUserInfo",
Handler: _User_GetUserInfo_Handler,
},
{
MethodName: "GetEnterpriseAuthStatus",
Handler: _User_GetEnterpriseAuthStatus_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
}
const (
WalletService_UpdateWallet_FullMethodName = "/WalletService/UpdateWallet"
WalletService_GetWallet_FullMethodName = "/WalletService/GetWallet"
WalletService_GetDeductions_FullMethodName = "/WalletService/GetDeductions"
WalletService_GetDeductionByTransactionId_FullMethodName = "/WalletService/GetDeductionByTransactionId"
WalletService_RechargeWallet_FullMethodName = "/WalletService/RechargeWallet"
WalletService_GetRechargeList_FullMethodName = "/WalletService/GetRechargeList"
)
// WalletServiceClient is the client API for WalletService 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.
//
// 定义钱包服务
type WalletServiceClient interface {
// 修改钱包余额
UpdateWallet(ctx context.Context, in *UpdateWalletRequest, opts ...grpc.CallOption) (*UpdateWalletResponse, error)
// 查询钱包信息
GetWallet(ctx context.Context, in *GetWalletRequest, opts ...grpc.CallOption) (*GetWalletResponse, error)
// 查询扣款记录
GetDeductions(ctx context.Context, in *GetDeductionsRequest, opts ...grpc.CallOption) (*GetDeductionsResponse, error)
GetDeductionByTransactionId(ctx context.Context, in *GetDeductionByTransactionIdRequest, opts ...grpc.CallOption) (*GetDeductionByTransactionIdResponse, error)
// 定义充值请求接口
RechargeWallet(ctx context.Context, in *RechargeWalletRequest, opts ...grpc.CallOption) (*RechargeWalletResponse, error)
// 充值记录列表篇
GetRechargeList(ctx context.Context, in *RechargeRequest, opts ...grpc.CallOption) (*RechargeResponse, error)
}
type walletServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWalletServiceClient(cc grpc.ClientConnInterface) WalletServiceClient {
return &walletServiceClient{cc}
}
func (c *walletServiceClient) UpdateWallet(ctx context.Context, in *UpdateWalletRequest, opts ...grpc.CallOption) (*UpdateWalletResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UpdateWalletResponse)
err := c.cc.Invoke(ctx, WalletService_UpdateWallet_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) GetWallet(ctx context.Context, in *GetWalletRequest, opts ...grpc.CallOption) (*GetWalletResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetWalletResponse)
err := c.cc.Invoke(ctx, WalletService_GetWallet_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) GetDeductions(ctx context.Context, in *GetDeductionsRequest, opts ...grpc.CallOption) (*GetDeductionsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetDeductionsResponse)
err := c.cc.Invoke(ctx, WalletService_GetDeductions_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) GetDeductionByTransactionId(ctx context.Context, in *GetDeductionByTransactionIdRequest, opts ...grpc.CallOption) (*GetDeductionByTransactionIdResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetDeductionByTransactionIdResponse)
err := c.cc.Invoke(ctx, WalletService_GetDeductionByTransactionId_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) RechargeWallet(ctx context.Context, in *RechargeWalletRequest, opts ...grpc.CallOption) (*RechargeWalletResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RechargeWalletResponse)
err := c.cc.Invoke(ctx, WalletService_RechargeWallet_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) GetRechargeList(ctx context.Context, in *RechargeRequest, opts ...grpc.CallOption) (*RechargeResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RechargeResponse)
err := c.cc.Invoke(ctx, WalletService_GetRechargeList_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// WalletServiceServer is the server API for WalletService service.
// All implementations must embed UnimplementedWalletServiceServer
// for forward compatibility
//
// 定义钱包服务
type WalletServiceServer interface {
// 修改钱包余额
UpdateWallet(context.Context, *UpdateWalletRequest) (*UpdateWalletResponse, error)
// 查询钱包信息
GetWallet(context.Context, *GetWalletRequest) (*GetWalletResponse, error)
// 查询扣款记录
GetDeductions(context.Context, *GetDeductionsRequest) (*GetDeductionsResponse, error)
GetDeductionByTransactionId(context.Context, *GetDeductionByTransactionIdRequest) (*GetDeductionByTransactionIdResponse, error)
// 定义充值请求接口
RechargeWallet(context.Context, *RechargeWalletRequest) (*RechargeWalletResponse, error)
// 充值记录列表篇
GetRechargeList(context.Context, *RechargeRequest) (*RechargeResponse, error)
mustEmbedUnimplementedWalletServiceServer()
}
// UnimplementedWalletServiceServer must be embedded to have forward compatible implementations.
type UnimplementedWalletServiceServer struct {
}
func (UnimplementedWalletServiceServer) UpdateWallet(context.Context, *UpdateWalletRequest) (*UpdateWalletResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateWallet not implemented")
}
func (UnimplementedWalletServiceServer) GetWallet(context.Context, *GetWalletRequest) (*GetWalletResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetWallet not implemented")
}
func (UnimplementedWalletServiceServer) GetDeductions(context.Context, *GetDeductionsRequest) (*GetDeductionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDeductions not implemented")
}
func (UnimplementedWalletServiceServer) GetDeductionByTransactionId(context.Context, *GetDeductionByTransactionIdRequest) (*GetDeductionByTransactionIdResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDeductionByTransactionId not implemented")
}
func (UnimplementedWalletServiceServer) RechargeWallet(context.Context, *RechargeWalletRequest) (*RechargeWalletResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RechargeWallet not implemented")
}
func (UnimplementedWalletServiceServer) GetRechargeList(context.Context, *RechargeRequest) (*RechargeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRechargeList not implemented")
}
func (UnimplementedWalletServiceServer) mustEmbedUnimplementedWalletServiceServer() {}
// UnsafeWalletServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WalletServiceServer will
// result in compilation errors.
type UnsafeWalletServiceServer interface {
mustEmbedUnimplementedWalletServiceServer()
}
func RegisterWalletServiceServer(s grpc.ServiceRegistrar, srv WalletServiceServer) {
s.RegisterService(&WalletService_ServiceDesc, srv)
}
func _WalletService_UpdateWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateWalletRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).UpdateWallet(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WalletService_UpdateWallet_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).UpdateWallet(ctx, req.(*UpdateWalletRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_GetWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetWalletRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).GetWallet(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WalletService_GetWallet_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).GetWallet(ctx, req.(*GetWalletRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_GetDeductions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetDeductionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).GetDeductions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WalletService_GetDeductions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).GetDeductions(ctx, req.(*GetDeductionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_GetDeductionByTransactionId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetDeductionByTransactionIdRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).GetDeductionByTransactionId(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WalletService_GetDeductionByTransactionId_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).GetDeductionByTransactionId(ctx, req.(*GetDeductionByTransactionIdRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_RechargeWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RechargeWalletRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).RechargeWallet(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WalletService_RechargeWallet_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).RechargeWallet(ctx, req.(*RechargeWalletRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WalletService_GetRechargeList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RechargeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WalletServiceServer).GetRechargeList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WalletService_GetRechargeList_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WalletServiceServer).GetRechargeList(ctx, req.(*RechargeRequest))
}
return interceptor(ctx, in, info, handler)
}
// WalletService_ServiceDesc is the grpc.ServiceDesc for WalletService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WalletService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "WalletService",
HandlerType: (*WalletServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "UpdateWallet",
Handler: _WalletService_UpdateWallet_Handler,
},
{
MethodName: "GetWallet",
Handler: _WalletService_GetWallet_Handler,
},
{
MethodName: "GetDeductions",
Handler: _WalletService_GetDeductions_Handler,
},
{
MethodName: "GetDeductionByTransactionId",
Handler: _WalletService_GetDeductionByTransactionId_Handler,
},
{
MethodName: "RechargeWallet",
Handler: _WalletService_RechargeWallet_Handler,
},
{
MethodName: "GetRechargeList",
Handler: _WalletService_GetRechargeList_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
}
const (
ApiRequestService_AddApiRequest_FullMethodName = "/ApiRequestService/AddApiRequest"
ApiRequestService_GetApiRequests_FullMethodName = "/ApiRequestService/GetApiRequests"
ApiRequestService_GetApiRequestByTransactionId_FullMethodName = "/ApiRequestService/GetApiRequestByTransactionId"
)
// ApiRequestServiceClient is the client API for ApiRequestService 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.
type ApiRequestServiceClient interface {
// 添加API请求记录
AddApiRequest(ctx context.Context, in *AddApiRequestRequest, opts ...grpc.CallOption) (*AddApiRequestResponse, error)
// 查询API请求记录
GetApiRequests(ctx context.Context, in *GetApiRequestsRequest, opts ...grpc.CallOption) (*GetApiRequestsResponse, error)
// 查询API请求记录ByTransactionId
GetApiRequestByTransactionId(ctx context.Context, in *GetApiRequestByTransactionIdRequest, opts ...grpc.CallOption) (*GetApiRequestByTransactionIdResponse, error)
}
type apiRequestServiceClient struct {
cc grpc.ClientConnInterface
}
func NewApiRequestServiceClient(cc grpc.ClientConnInterface) ApiRequestServiceClient {
return &apiRequestServiceClient{cc}
}
func (c *apiRequestServiceClient) AddApiRequest(ctx context.Context, in *AddApiRequestRequest, opts ...grpc.CallOption) (*AddApiRequestResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddApiRequestResponse)
err := c.cc.Invoke(ctx, ApiRequestService_AddApiRequest_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *apiRequestServiceClient) GetApiRequests(ctx context.Context, in *GetApiRequestsRequest, opts ...grpc.CallOption) (*GetApiRequestsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetApiRequestsResponse)
err := c.cc.Invoke(ctx, ApiRequestService_GetApiRequests_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *apiRequestServiceClient) GetApiRequestByTransactionId(ctx context.Context, in *GetApiRequestByTransactionIdRequest, opts ...grpc.CallOption) (*GetApiRequestByTransactionIdResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetApiRequestByTransactionIdResponse)
err := c.cc.Invoke(ctx, ApiRequestService_GetApiRequestByTransactionId_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ApiRequestServiceServer is the server API for ApiRequestService service.
// All implementations must embed UnimplementedApiRequestServiceServer
// for forward compatibility
type ApiRequestServiceServer interface {
// 添加API请求记录
AddApiRequest(context.Context, *AddApiRequestRequest) (*AddApiRequestResponse, error)
// 查询API请求记录
GetApiRequests(context.Context, *GetApiRequestsRequest) (*GetApiRequestsResponse, error)
// 查询API请求记录ByTransactionId
GetApiRequestByTransactionId(context.Context, *GetApiRequestByTransactionIdRequest) (*GetApiRequestByTransactionIdResponse, error)
mustEmbedUnimplementedApiRequestServiceServer()
}
// UnimplementedApiRequestServiceServer must be embedded to have forward compatible implementations.
type UnimplementedApiRequestServiceServer struct {
}
func (UnimplementedApiRequestServiceServer) AddApiRequest(context.Context, *AddApiRequestRequest) (*AddApiRequestResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddApiRequest not implemented")
}
func (UnimplementedApiRequestServiceServer) GetApiRequests(context.Context, *GetApiRequestsRequest) (*GetApiRequestsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetApiRequests not implemented")
}
func (UnimplementedApiRequestServiceServer) GetApiRequestByTransactionId(context.Context, *GetApiRequestByTransactionIdRequest) (*GetApiRequestByTransactionIdResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetApiRequestByTransactionId not implemented")
}
func (UnimplementedApiRequestServiceServer) mustEmbedUnimplementedApiRequestServiceServer() {}
// UnsafeApiRequestServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ApiRequestServiceServer will
// result in compilation errors.
type UnsafeApiRequestServiceServer interface {
mustEmbedUnimplementedApiRequestServiceServer()
}
func RegisterApiRequestServiceServer(s grpc.ServiceRegistrar, srv ApiRequestServiceServer) {
s.RegisterService(&ApiRequestService_ServiceDesc, srv)
}
func _ApiRequestService_AddApiRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddApiRequestRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiRequestServiceServer).AddApiRequest(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ApiRequestService_AddApiRequest_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiRequestServiceServer).AddApiRequest(ctx, req.(*AddApiRequestRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ApiRequestService_GetApiRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetApiRequestsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiRequestServiceServer).GetApiRequests(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ApiRequestService_GetApiRequests_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiRequestServiceServer).GetApiRequests(ctx, req.(*GetApiRequestsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ApiRequestService_GetApiRequestByTransactionId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetApiRequestByTransactionIdRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ApiRequestServiceServer).GetApiRequestByTransactionId(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ApiRequestService_GetApiRequestByTransactionId_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ApiRequestServiceServer).GetApiRequestByTransactionId(ctx, req.(*GetApiRequestByTransactionIdRequest))
}
return interceptor(ctx, in, info, handler)
}
// ApiRequestService_ServiceDesc is the grpc.ServiceDesc for ApiRequestService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ApiRequestService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ApiRequestService",
HandlerType: (*ApiRequestServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "AddApiRequest",
Handler: _ApiRequestService_AddApiRequest_Handler,
},
{
MethodName: "GetApiRequests",
Handler: _ApiRequestService_GetApiRequests_Handler,
},
{
MethodName: "GetApiRequestByTransactionId",
Handler: _ApiRequestService_GetApiRequestByTransactionId_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
}