feat: client items

This commit is contained in:
zzw
2026-09-16 16:08:45 +08:00
parent 9af9cc6059
commit 5a56eb2fe4
8 changed files with 231 additions and 26 deletions
+38
View File
@@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion9
const (
User_Login_FullMethodName = "/user.User/Login"
User_Info_FullMethodName = "/user.User/Info"
User_Client_FullMethodName = "/user.User/Client"
User_UserItems_FullMethodName = "/user.User/UserItems"
User_UserStatus_FullMethodName = "/user.User/UserStatus"
User_InternalCreate_FullMethodName = "/user.User/InternalCreate"
@@ -38,6 +39,7 @@ const (
type UserClient interface {
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*Response, error)
Info(ctx context.Context, in *InfoReq, opts ...grpc.CallOption) (*Response, error)
Client(ctx context.Context, in *ClientReq, opts ...grpc.CallOption) (*Response, error)
UserItems(ctx context.Context, in *UserItemsReq, opts ...grpc.CallOption) (*Response, error)
UserStatus(ctx context.Context, in *UserStatusReq, opts ...grpc.CallOption) (*Response, error)
InternalCreate(ctx context.Context, in *InternalCreateReq, opts ...grpc.CallOption) (*InternalCreateData, error)
@@ -77,6 +79,16 @@ func (c *userClient) Info(ctx context.Context, in *InfoReq, opts ...grpc.CallOpt
return out, nil
}
func (c *userClient) Client(ctx context.Context, in *ClientReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, User_Client_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) UserItems(ctx context.Context, in *UserItemsReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
@@ -173,6 +185,7 @@ func (c *userClient) InternalRevokeBizClient(ctx context.Context, in *InternalRe
type UserServer interface {
Login(context.Context, *LoginReq) (*Response, error)
Info(context.Context, *InfoReq) (*Response, error)
Client(context.Context, *ClientReq) (*Response, error)
UserItems(context.Context, *UserItemsReq) (*Response, error)
UserStatus(context.Context, *UserStatusReq) (*Response, error)
InternalCreate(context.Context, *InternalCreateReq) (*InternalCreateData, error)
@@ -198,6 +211,9 @@ func (UnimplementedUserServer) Login(context.Context, *LoginReq) (*Response, err
func (UnimplementedUserServer) Info(context.Context, *InfoReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method Info not implemented")
}
func (UnimplementedUserServer) Client(context.Context, *ClientReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method Client not implemented")
}
func (UnimplementedUserServer) UserItems(context.Context, *UserItemsReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method UserItems not implemented")
}
@@ -282,6 +298,24 @@ func _User_Info_Handler(srv interface{}, ctx context.Context, dec func(interface
return interceptor(ctx, in, info, handler)
}
func _User_Client_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ClientReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).Client(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: User_Client_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).Client(ctx, req.(*ClientReq))
}
return interceptor(ctx, in, info, handler)
}
func _User_UserItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UserItemsReq)
if err := dec(in); err != nil {
@@ -459,6 +493,10 @@ var User_ServiceDesc = grpc.ServiceDesc{
MethodName: "Info",
Handler: _User_Info_Handler,
},
{
MethodName: "Client",
Handler: _User_Client_Handler,
},
{
MethodName: "UserItems",
Handler: _User_UserItems_Handler,