1、新增自定义用户私人价格2、优化api服务鉴权缓存3、新增管理员端对公充值

This commit is contained in:
2024-10-21 16:01:20 +08:00
parent 8896fd6b30
commit 2292d25d74
37 changed files with 1903 additions and 907 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -29,8 +29,6 @@ const (
// WhitelistClient is the client API for Whitelist 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.
//
// Service definitions for Whitelist, Secrets, Products, and UserProducts
type WhitelistClient interface {
// Whitelist methods
CreateWhitelist(ctx context.Context, in *CreateWhitelistRequest, opts ...grpc.CallOption) (*Whitelist, error)
@@ -101,8 +99,6 @@ func (c *whitelistClient) MatchWhitelistByIp(ctx context.Context, in *MatchWhite
// WhitelistServer is the server API for Whitelist service.
// All implementations must embed UnimplementedWhitelistServer
// for forward compatibility
//
// Service definitions for Whitelist, Secrets, Products, and UserProducts
type WhitelistServer interface {
// Whitelist methods
CreateWhitelist(context.Context, *CreateWhitelistRequest) (*Whitelist, error)
@@ -722,6 +718,7 @@ var Product_ServiceDesc = grpc.ServiceDesc{
const (
UserProduct_CreateUserProduct_FullMethodName = "/userProduct/CreateUserProduct"
UserProduct_GetUserProductPageList_FullMethodName = "/userProduct/GetUserProductPageList"
UserProduct_GetUserProduct_FullMethodName = "/userProduct/GetUserProduct"
UserProduct_MatchingUserIdProductCode_FullMethodName = "/userProduct/MatchingUserIdProductCode"
)
@@ -731,7 +728,8 @@ const (
type UserProductClient interface {
// UserProduct methods
CreateUserProduct(ctx context.Context, in *CreateUserProductRequest, opts ...grpc.CallOption) (*UserProductEmptyResponse, error)
GetUserProductPageList(ctx context.Context, in *UserProuctPageListRequest, opts ...grpc.CallOption) (*UserProductResponse, error)
GetUserProductPageList(ctx context.Context, in *UserProuctPageListRequest, opts ...grpc.CallOption) (*UserProductPageListResponse, error)
GetUserProduct(ctx context.Context, in *UserProuctRequest, opts ...grpc.CallOption) (*UserProductResponse, error)
MatchingUserIdProductCode(ctx context.Context, in *MatchingUserIdProductCodeRequest, opts ...grpc.CallOption) (*MatchResponse, error)
}
@@ -753,10 +751,20 @@ func (c *userProductClient) CreateUserProduct(ctx context.Context, in *CreateUse
return out, nil
}
func (c *userProductClient) GetUserProductPageList(ctx context.Context, in *UserProuctPageListRequest, opts ...grpc.CallOption) (*UserProductResponse, error) {
func (c *userProductClient) GetUserProductPageList(ctx context.Context, in *UserProuctPageListRequest, opts ...grpc.CallOption) (*UserProductPageListResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UserProductPageListResponse)
err := c.cc.Invoke(ctx, UserProduct_GetUserProductPageList_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userProductClient) GetUserProduct(ctx context.Context, in *UserProuctRequest, opts ...grpc.CallOption) (*UserProductResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UserProductResponse)
err := c.cc.Invoke(ctx, UserProduct_GetUserProductPageList_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, UserProduct_GetUserProduct_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -779,7 +787,8 @@ func (c *userProductClient) MatchingUserIdProductCode(ctx context.Context, in *M
type UserProductServer interface {
// UserProduct methods
CreateUserProduct(context.Context, *CreateUserProductRequest) (*UserProductEmptyResponse, error)
GetUserProductPageList(context.Context, *UserProuctPageListRequest) (*UserProductResponse, error)
GetUserProductPageList(context.Context, *UserProuctPageListRequest) (*UserProductPageListResponse, error)
GetUserProduct(context.Context, *UserProuctRequest) (*UserProductResponse, error)
MatchingUserIdProductCode(context.Context, *MatchingUserIdProductCodeRequest) (*MatchResponse, error)
mustEmbedUnimplementedUserProductServer()
}
@@ -791,9 +800,12 @@ type UnimplementedUserProductServer struct {
func (UnimplementedUserProductServer) CreateUserProduct(context.Context, *CreateUserProductRequest) (*UserProductEmptyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateUserProduct not implemented")
}
func (UnimplementedUserProductServer) GetUserProductPageList(context.Context, *UserProuctPageListRequest) (*UserProductResponse, error) {
func (UnimplementedUserProductServer) GetUserProductPageList(context.Context, *UserProuctPageListRequest) (*UserProductPageListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserProductPageList not implemented")
}
func (UnimplementedUserProductServer) GetUserProduct(context.Context, *UserProuctRequest) (*UserProductResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserProduct not implemented")
}
func (UnimplementedUserProductServer) MatchingUserIdProductCode(context.Context, *MatchingUserIdProductCodeRequest) (*MatchResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method MatchingUserIdProductCode not implemented")
}
@@ -846,6 +858,24 @@ func _UserProduct_GetUserProductPageList_Handler(srv interface{}, ctx context.Co
return interceptor(ctx, in, info, handler)
}
func _UserProduct_GetUserProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UserProuctRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserProductServer).GetUserProduct(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserProduct_GetUserProduct_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserProductServer).GetUserProduct(ctx, req.(*UserProuctRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserProduct_MatchingUserIdProductCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MatchingUserIdProductCodeRequest)
if err := dec(in); err != nil {
@@ -879,6 +909,10 @@ var UserProduct_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetUserProductPageList",
Handler: _UserProduct_GetUserProductPageList_Handler,
},
{
MethodName: "GetUserProduct",
Handler: _UserProduct_GetUserProduct_Handler,
},
{
MethodName: "MatchingUserIdProductCode",
Handler: _UserProduct_MatchingUserIdProductCode_Handler,