feat: analysis user auth and ws
This commit is contained in:
@@ -20,6 +20,9 @@ const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
User_Login_FullMethodName = "/user.User/Login"
|
||||
User_GenerateQrcode_FullMethodName = "/user.User/GenerateQrcode"
|
||||
User_QrcodeScan_FullMethodName = "/user.User/QrcodeScan"
|
||||
User_QrcodeLogin_FullMethodName = "/user.User/QrcodeLogin"
|
||||
User_Info_FullMethodName = "/user.User/Info"
|
||||
User_Password_FullMethodName = "/user.User/Password"
|
||||
User_GetOpenid_FullMethodName = "/user.User/GetOpenid"
|
||||
@@ -34,6 +37,7 @@ const (
|
||||
User_InternalUpdateMobile_FullMethodName = "/user.User/InternalUpdateMobile"
|
||||
User_InternalRevokeBizClient_FullMethodName = "/user.User/InternalRevokeBizClient"
|
||||
User_InternalGetUserInfo_FullMethodName = "/user.User/InternalGetUserInfo"
|
||||
User_InternalVerifyPassword_FullMethodName = "/user.User/InternalVerifyPassword"
|
||||
)
|
||||
|
||||
// UserClient is the client API for User service.
|
||||
@@ -41,6 +45,9 @@ const (
|
||||
// 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 {
|
||||
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*Response, error)
|
||||
GenerateQrcode(ctx context.Context, in *GenerateQrcodeReq, opts ...grpc.CallOption) (*Response, error)
|
||||
QrcodeScan(ctx context.Context, in *QrcodeScanReq, opts ...grpc.CallOption) (*Response, error)
|
||||
QrcodeLogin(ctx context.Context, in *QrcodeLoginReq, opts ...grpc.CallOption) (*Response, error)
|
||||
Info(ctx context.Context, in *InfoReq, opts ...grpc.CallOption) (*Response, error)
|
||||
Password(ctx context.Context, in *PasswordReq, opts ...grpc.CallOption) (*Response, error)
|
||||
GetOpenid(ctx context.Context, in *GetOpenidReq, opts ...grpc.CallOption) (*Response, error)
|
||||
@@ -55,6 +62,7 @@ type UserClient interface {
|
||||
InternalUpdateMobile(ctx context.Context, in *InternalUpdateMobileReq, opts ...grpc.CallOption) (*InternalUpdateMobileData, error)
|
||||
InternalRevokeBizClient(ctx context.Context, in *InternalRevokeBizClientReq, opts ...grpc.CallOption) (*InternalRevokeBizClientData, error)
|
||||
InternalGetUserInfo(ctx context.Context, in *InternalGetUserInfoReq, opts ...grpc.CallOption) (*InternalGetUserInfoData, error)
|
||||
InternalVerifyPassword(ctx context.Context, in *InternalVerifyPasswordReq, opts ...grpc.CallOption) (*InternalVerifyPasswordData, error)
|
||||
}
|
||||
|
||||
type userClient struct {
|
||||
@@ -75,6 +83,36 @@ func (c *userClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallO
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userClient) GenerateQrcode(ctx context.Context, in *GenerateQrcodeReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, User_GenerateQrcode_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userClient) QrcodeScan(ctx context.Context, in *QrcodeScanReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, User_QrcodeScan_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userClient) QrcodeLogin(ctx context.Context, in *QrcodeLoginReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, User_QrcodeLogin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userClient) Info(ctx context.Context, in *InfoReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
@@ -215,11 +253,24 @@ func (c *userClient) InternalGetUserInfo(ctx context.Context, in *InternalGetUse
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userClient) InternalVerifyPassword(ctx context.Context, in *InternalVerifyPasswordReq, opts ...grpc.CallOption) (*InternalVerifyPasswordData, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InternalVerifyPasswordData)
|
||||
err := c.cc.Invoke(ctx, User_InternalVerifyPassword_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 {
|
||||
Login(context.Context, *LoginReq) (*Response, error)
|
||||
GenerateQrcode(context.Context, *GenerateQrcodeReq) (*Response, error)
|
||||
QrcodeScan(context.Context, *QrcodeScanReq) (*Response, error)
|
||||
QrcodeLogin(context.Context, *QrcodeLoginReq) (*Response, error)
|
||||
Info(context.Context, *InfoReq) (*Response, error)
|
||||
Password(context.Context, *PasswordReq) (*Response, error)
|
||||
GetOpenid(context.Context, *GetOpenidReq) (*Response, error)
|
||||
@@ -234,6 +285,7 @@ type UserServer interface {
|
||||
InternalUpdateMobile(context.Context, *InternalUpdateMobileReq) (*InternalUpdateMobileData, error)
|
||||
InternalRevokeBizClient(context.Context, *InternalRevokeBizClientReq) (*InternalRevokeBizClientData, error)
|
||||
InternalGetUserInfo(context.Context, *InternalGetUserInfoReq) (*InternalGetUserInfoData, error)
|
||||
InternalVerifyPassword(context.Context, *InternalVerifyPasswordReq) (*InternalVerifyPasswordData, error)
|
||||
mustEmbedUnimplementedUserServer()
|
||||
}
|
||||
|
||||
@@ -247,6 +299,15 @@ type UnimplementedUserServer struct{}
|
||||
func (UnimplementedUserServer) Login(context.Context, *LoginReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
|
||||
}
|
||||
func (UnimplementedUserServer) GenerateQrcode(context.Context, *GenerateQrcodeReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GenerateQrcode not implemented")
|
||||
}
|
||||
func (UnimplementedUserServer) QrcodeScan(context.Context, *QrcodeScanReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method QrcodeScan not implemented")
|
||||
}
|
||||
func (UnimplementedUserServer) QrcodeLogin(context.Context, *QrcodeLoginReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method QrcodeLogin not implemented")
|
||||
}
|
||||
func (UnimplementedUserServer) Info(context.Context, *InfoReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Info not implemented")
|
||||
}
|
||||
@@ -289,6 +350,9 @@ func (UnimplementedUserServer) InternalRevokeBizClient(context.Context, *Interna
|
||||
func (UnimplementedUserServer) InternalGetUserInfo(context.Context, *InternalGetUserInfoReq) (*InternalGetUserInfoData, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InternalGetUserInfo not implemented")
|
||||
}
|
||||
func (UnimplementedUserServer) InternalVerifyPassword(context.Context, *InternalVerifyPasswordReq) (*InternalVerifyPasswordData, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InternalVerifyPassword not implemented")
|
||||
}
|
||||
func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
|
||||
func (UnimplementedUserServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -328,6 +392,60 @@ func _User_Login_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _User_GenerateQrcode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GenerateQrcodeReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServer).GenerateQrcode(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: User_GenerateQrcode_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServer).GenerateQrcode(ctx, req.(*GenerateQrcodeReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _User_QrcodeScan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QrcodeScanReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServer).QrcodeScan(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: User_QrcodeScan_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServer).QrcodeScan(ctx, req.(*QrcodeScanReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _User_QrcodeLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QrcodeLoginReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServer).QrcodeLogin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: User_QrcodeLogin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServer).QrcodeLogin(ctx, req.(*QrcodeLoginReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _User_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InfoReq)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -580,6 +698,24 @@ func _User_InternalGetUserInfo_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _User_InternalVerifyPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InternalVerifyPasswordReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserServer).InternalVerifyPassword(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: User_InternalVerifyPassword_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserServer).InternalVerifyPassword(ctx, req.(*InternalVerifyPasswordReq))
|
||||
}
|
||||
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)
|
||||
@@ -591,6 +727,18 @@ var User_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Login",
|
||||
Handler: _User_Login_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GenerateQrcode",
|
||||
Handler: _User_GenerateQrcode_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "QrcodeScan",
|
||||
Handler: _User_QrcodeScan_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "QrcodeLogin",
|
||||
Handler: _User_QrcodeLogin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Info",
|
||||
Handler: _User_Info_Handler,
|
||||
@@ -647,6 +795,10 @@ var User_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "InternalGetUserInfo",
|
||||
Handler: _User_InternalGetUserInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InternalVerifyPassword",
|
||||
Handler: _User_InternalVerifyPassword_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "user/user.proto",
|
||||
|
||||
Reference in New Issue
Block a user