This commit is contained in:
2024-10-12 20:41:55 +08:00
parent 8c09120db6
commit 597e4f1b89
75 changed files with 5009 additions and 823 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -374,6 +374,7 @@ var Auth_ServiceDesc = grpc.ServiceDesc{
const (
User_UserInfo_FullMethodName = "/User/UserInfo"
User_GetUserInfo_FullMethodName = "/User/GetUserInfo"
User_GetEnterpriseAuthStatus_FullMethodName = "/User/GetEnterpriseAuthStatus"
)
@@ -383,6 +384,7 @@ const (
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)
}
@@ -404,6 +406,16 @@ func (c *userClient) UserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc
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)
@@ -420,6 +432,7 @@ func (c *userClient) GetEnterpriseAuthStatus(ctx context.Context, in *GetEnterpr
type UserServer interface {
// 获取用户信息
UserInfo(context.Context, *UserInfoReq) (*UserInfoResp, error)
GetUserInfo(context.Context, *UserInfoReq) (*GetUserInfoResp, error)
GetEnterpriseAuthStatus(context.Context, *GetEnterpriseAuthStatusReq) (*GetEnterpriseAuthStatusResp, error)
mustEmbedUnimplementedUserServer()
}
@@ -431,6 +444,9 @@ 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")
}
@@ -465,6 +481,24 @@ func _User_UserInfo_Handler(srv interface{}, ctx context.Context, dec func(inter
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 {
@@ -494,6 +528,10 @@ var User_ServiceDesc = grpc.ServiceDesc{
MethodName: "UserInfo",
Handler: _User_UserInfo_Handler,
},
{
MethodName: "GetUserInfo",
Handler: _User_GetUserInfo_Handler,
},
{
MethodName: "GetEnterpriseAuthStatus",
Handler: _User_GetEnterpriseAuthStatus_Handler,
@@ -502,3 +540,391 @@ var User_ServiceDesc = grpc.ServiceDesc{
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"
)
// 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)
}
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
}
// 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)
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) 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)
}
// 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,
},
},
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",
}