feat: analysis user auth and ws
This commit is contained in:
@@ -19,103 +19,639 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AnalysisAuth_GenerateQrcode_FullMethodName = "/analysis.AnalysisAuth/GenerateQrcode"
|
||||
Analysis_InternalCreateUser_FullMethodName = "/analysis.Analysis/InternalCreateUser"
|
||||
Analysis_AgreementInfo_FullMethodName = "/analysis.Analysis/AgreementInfo"
|
||||
Analysis_Switch_FullMethodName = "/analysis.Analysis/Switch"
|
||||
)
|
||||
|
||||
// AnalysisAuthClient is the client API for AnalysisAuth service.
|
||||
// AnalysisClient is the client API for Analysis 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 AnalysisAuthClient interface {
|
||||
GenerateQrcode(ctx context.Context, in *GenerateQrcodeRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
type AnalysisClient interface {
|
||||
InternalCreateUser(ctx context.Context, in *InternalCreateUserReq, opts ...grpc.CallOption) (*InternalCreateUserData, error)
|
||||
AgreementInfo(ctx context.Context, in *AgreementInfoReq, opts ...grpc.CallOption) (*Response, error)
|
||||
Switch(ctx context.Context, in *SwitchReq, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type analysisAuthClient struct {
|
||||
type analysisClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAnalysisAuthClient(cc grpc.ClientConnInterface) AnalysisAuthClient {
|
||||
return &analysisAuthClient{cc}
|
||||
func NewAnalysisClient(cc grpc.ClientConnInterface) AnalysisClient {
|
||||
return &analysisClient{cc}
|
||||
}
|
||||
|
||||
func (c *analysisAuthClient) GenerateQrcode(ctx context.Context, in *GenerateQrcodeRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
func (c *analysisClient) InternalCreateUser(ctx context.Context, in *InternalCreateUserReq, opts ...grpc.CallOption) (*InternalCreateUserData, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisAuth_GenerateQrcode_FullMethodName, in, out, cOpts...)
|
||||
out := new(InternalCreateUserData)
|
||||
err := c.cc.Invoke(ctx, Analysis_InternalCreateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AnalysisAuthServer is the server API for AnalysisAuth service.
|
||||
// All implementations must embed UnimplementedAnalysisAuthServer
|
||||
// for forward compatibility.
|
||||
type AnalysisAuthServer interface {
|
||||
GenerateQrcode(context.Context, *GenerateQrcodeRequest) (*Response, error)
|
||||
mustEmbedUnimplementedAnalysisAuthServer()
|
||||
func (c *analysisClient) AgreementInfo(ctx context.Context, in *AgreementInfoReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Analysis_AgreementInfo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UnimplementedAnalysisAuthServer must be embedded to have
|
||||
func (c *analysisClient) Switch(ctx context.Context, in *SwitchReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Analysis_Switch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AnalysisServer is the server API for Analysis service.
|
||||
// All implementations must embed UnimplementedAnalysisServer
|
||||
// for forward compatibility.
|
||||
type AnalysisServer interface {
|
||||
InternalCreateUser(context.Context, *InternalCreateUserReq) (*InternalCreateUserData, error)
|
||||
AgreementInfo(context.Context, *AgreementInfoReq) (*Response, error)
|
||||
Switch(context.Context, *SwitchReq) (*Response, error)
|
||||
mustEmbedUnimplementedAnalysisServer()
|
||||
}
|
||||
|
||||
// UnimplementedAnalysisServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAnalysisAuthServer struct{}
|
||||
type UnimplementedAnalysisServer struct{}
|
||||
|
||||
func (UnimplementedAnalysisAuthServer) GenerateQrcode(context.Context, *GenerateQrcodeRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GenerateQrcode not implemented")
|
||||
func (UnimplementedAnalysisServer) InternalCreateUser(context.Context, *InternalCreateUserReq) (*InternalCreateUserData, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InternalCreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisAuthServer) mustEmbedUnimplementedAnalysisAuthServer() {}
|
||||
func (UnimplementedAnalysisAuthServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedAnalysisServer) AgreementInfo(context.Context, *AgreementInfoReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AgreementInfo not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisServer) Switch(context.Context, *SwitchReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Switch not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisServer) mustEmbedUnimplementedAnalysisServer() {}
|
||||
func (UnimplementedAnalysisServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAnalysisAuthServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AnalysisAuthServer will
|
||||
// UnsafeAnalysisServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AnalysisServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAnalysisAuthServer interface {
|
||||
mustEmbedUnimplementedAnalysisAuthServer()
|
||||
type UnsafeAnalysisServer interface {
|
||||
mustEmbedUnimplementedAnalysisServer()
|
||||
}
|
||||
|
||||
func RegisterAnalysisAuthServer(s grpc.ServiceRegistrar, srv AnalysisAuthServer) {
|
||||
// If the following call panics, it indicates UnimplementedAnalysisAuthServer was
|
||||
func RegisterAnalysisServer(s grpc.ServiceRegistrar, srv AnalysisServer) {
|
||||
// If the following call panics, it indicates UnimplementedAnalysisServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AnalysisAuth_ServiceDesc, srv)
|
||||
s.RegisterService(&Analysis_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AnalysisAuth_GenerateQrcode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GenerateQrcodeRequest)
|
||||
func _Analysis_InternalCreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InternalCreateUserReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisAuthServer).GenerateQrcode(ctx, in)
|
||||
return srv.(AnalysisServer).InternalCreateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisAuth_GenerateQrcode_FullMethodName,
|
||||
FullMethod: Analysis_InternalCreateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisAuthServer).GenerateQrcode(ctx, req.(*GenerateQrcodeRequest))
|
||||
return srv.(AnalysisServer).InternalCreateUser(ctx, req.(*InternalCreateUserReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AnalysisAuth_ServiceDesc is the grpc.ServiceDesc for AnalysisAuth service.
|
||||
func _Analysis_AgreementInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AgreementInfoReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisServer).AgreementInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Analysis_AgreementInfo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisServer).AgreementInfo(ctx, req.(*AgreementInfoReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Analysis_Switch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SwitchReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisServer).Switch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Analysis_Switch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisServer).Switch(ctx, req.(*SwitchReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Analysis_ServiceDesc is the grpc.ServiceDesc for Analysis service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AnalysisAuth_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "analysis.AnalysisAuth",
|
||||
HandlerType: (*AnalysisAuthServer)(nil),
|
||||
var Analysis_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "analysis.Analysis",
|
||||
HandlerType: (*AnalysisServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GenerateQrcode",
|
||||
Handler: _AnalysisAuth_GenerateQrcode_Handler,
|
||||
MethodName: "InternalCreateUser",
|
||||
Handler: _Analysis_InternalCreateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AgreementInfo",
|
||||
Handler: _Analysis_AgreementInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Switch",
|
||||
Handler: _Analysis_Switch_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "analysis/analysis.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
AnalysisUser_UserRegister_FullMethodName = "/analysis.AnalysisUser/UserRegister"
|
||||
AnalysisUser_FaceBind_FullMethodName = "/analysis.AnalysisUser/FaceBind"
|
||||
AnalysisUser_UserImprove_FullMethodName = "/analysis.AnalysisUser/UserImprove"
|
||||
AnalysisUser_UserDelete_FullMethodName = "/analysis.AnalysisUser/UserDelete"
|
||||
AnalysisUser_UserAuth_FullMethodName = "/analysis.AnalysisUser/UserAuth"
|
||||
)
|
||||
|
||||
// AnalysisUserClient is the client API for AnalysisUser 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 AnalysisUserClient interface {
|
||||
UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*Response, error)
|
||||
FaceBind(ctx context.Context, in *FaceBindReq, opts ...grpc.CallOption) (*Response, error)
|
||||
UserImprove(ctx context.Context, in *UserImproveReq, opts ...grpc.CallOption) (*Response, error)
|
||||
UserDelete(ctx context.Context, in *UserDeleteReq, opts ...grpc.CallOption) (*Response, error)
|
||||
// 用户扫码确认/拒绝授权
|
||||
UserAuth(ctx context.Context, in *UserAuthReq, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type analysisUserClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAnalysisUserClient(cc grpc.ClientConnInterface) AnalysisUserClient {
|
||||
return &analysisUserClient{cc}
|
||||
}
|
||||
|
||||
func (c *analysisUserClient) UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisUser_UserRegister_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *analysisUserClient) FaceBind(ctx context.Context, in *FaceBindReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisUser_FaceBind_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *analysisUserClient) UserImprove(ctx context.Context, in *UserImproveReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisUser_UserImprove_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *analysisUserClient) UserDelete(ctx context.Context, in *UserDeleteReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisUser_UserDelete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *analysisUserClient) UserAuth(ctx context.Context, in *UserAuthReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisUser_UserAuth_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AnalysisUserServer is the server API for AnalysisUser service.
|
||||
// All implementations must embed UnimplementedAnalysisUserServer
|
||||
// for forward compatibility.
|
||||
type AnalysisUserServer interface {
|
||||
UserRegister(context.Context, *UserRegisterReq) (*Response, error)
|
||||
FaceBind(context.Context, *FaceBindReq) (*Response, error)
|
||||
UserImprove(context.Context, *UserImproveReq) (*Response, error)
|
||||
UserDelete(context.Context, *UserDeleteReq) (*Response, error)
|
||||
// 用户扫码确认/拒绝授权
|
||||
UserAuth(context.Context, *UserAuthReq) (*Response, error)
|
||||
mustEmbedUnimplementedAnalysisUserServer()
|
||||
}
|
||||
|
||||
// UnimplementedAnalysisUserServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAnalysisUserServer struct{}
|
||||
|
||||
func (UnimplementedAnalysisUserServer) UserRegister(context.Context, *UserRegisterReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UserRegister not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisUserServer) FaceBind(context.Context, *FaceBindReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method FaceBind not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisUserServer) UserImprove(context.Context, *UserImproveReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UserImprove not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisUserServer) UserDelete(context.Context, *UserDeleteReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UserDelete not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisUserServer) UserAuth(context.Context, *UserAuthReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UserAuth not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisUserServer) mustEmbedUnimplementedAnalysisUserServer() {}
|
||||
func (UnimplementedAnalysisUserServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAnalysisUserServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AnalysisUserServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAnalysisUserServer interface {
|
||||
mustEmbedUnimplementedAnalysisUserServer()
|
||||
}
|
||||
|
||||
func RegisterAnalysisUserServer(s grpc.ServiceRegistrar, srv AnalysisUserServer) {
|
||||
// If the following call panics, it indicates UnimplementedAnalysisUserServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AnalysisUser_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AnalysisUser_UserRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UserRegisterReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisUserServer).UserRegister(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisUser_UserRegister_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisUserServer).UserRegister(ctx, req.(*UserRegisterReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AnalysisUser_FaceBind_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FaceBindReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisUserServer).FaceBind(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisUser_FaceBind_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisUserServer).FaceBind(ctx, req.(*FaceBindReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AnalysisUser_UserImprove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UserImproveReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisUserServer).UserImprove(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisUser_UserImprove_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisUserServer).UserImprove(ctx, req.(*UserImproveReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AnalysisUser_UserDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UserDeleteReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisUserServer).UserDelete(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisUser_UserDelete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisUserServer).UserDelete(ctx, req.(*UserDeleteReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AnalysisUser_UserAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UserAuthReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisUserServer).UserAuth(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisUser_UserAuth_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisUserServer).UserAuth(ctx, req.(*UserAuthReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AnalysisUser_ServiceDesc is the grpc.ServiceDesc for AnalysisUser service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AnalysisUser_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "analysis.AnalysisUser",
|
||||
HandlerType: (*AnalysisUserServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "UserRegister",
|
||||
Handler: _AnalysisUser_UserRegister_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FaceBind",
|
||||
Handler: _AnalysisUser_FaceBind_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UserImprove",
|
||||
Handler: _AnalysisUser_UserImprove_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UserDelete",
|
||||
Handler: _AnalysisUser_UserDelete_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UserAuth",
|
||||
Handler: _AnalysisUser_UserAuth_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "analysis/analysis.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
AnalysisStore_StoreAuth_FullMethodName = "/analysis.AnalysisStore/StoreAuth"
|
||||
AnalysisStore_StoreAuthQrcode_FullMethodName = "/analysis.AnalysisStore/StoreAuthQrcode"
|
||||
)
|
||||
|
||||
// AnalysisStoreClient is the client API for AnalysisStore 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 AnalysisStoreClient interface {
|
||||
// 门店账号密码授权用户
|
||||
StoreAuth(ctx context.Context, in *StoreAuthReq, opts ...grpc.CallOption) (*Response, error)
|
||||
// 门店获取扫码授权二维码
|
||||
StoreAuthQrcode(ctx context.Context, in *StoreAuthQrcodeReq, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type analysisStoreClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAnalysisStoreClient(cc grpc.ClientConnInterface) AnalysisStoreClient {
|
||||
return &analysisStoreClient{cc}
|
||||
}
|
||||
|
||||
func (c *analysisStoreClient) StoreAuth(ctx context.Context, in *StoreAuthReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisStore_StoreAuth_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *analysisStoreClient) StoreAuthQrcode(ctx context.Context, in *StoreAuthQrcodeReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, AnalysisStore_StoreAuthQrcode_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AnalysisStoreServer is the server API for AnalysisStore service.
|
||||
// All implementations must embed UnimplementedAnalysisStoreServer
|
||||
// for forward compatibility.
|
||||
type AnalysisStoreServer interface {
|
||||
// 门店账号密码授权用户
|
||||
StoreAuth(context.Context, *StoreAuthReq) (*Response, error)
|
||||
// 门店获取扫码授权二维码
|
||||
StoreAuthQrcode(context.Context, *StoreAuthQrcodeReq) (*Response, error)
|
||||
mustEmbedUnimplementedAnalysisStoreServer()
|
||||
}
|
||||
|
||||
// UnimplementedAnalysisStoreServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAnalysisStoreServer struct{}
|
||||
|
||||
func (UnimplementedAnalysisStoreServer) StoreAuth(context.Context, *StoreAuthReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method StoreAuth not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisStoreServer) StoreAuthQrcode(context.Context, *StoreAuthQrcodeReq) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method StoreAuthQrcode not implemented")
|
||||
}
|
||||
func (UnimplementedAnalysisStoreServer) mustEmbedUnimplementedAnalysisStoreServer() {}
|
||||
func (UnimplementedAnalysisStoreServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAnalysisStoreServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AnalysisStoreServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAnalysisStoreServer interface {
|
||||
mustEmbedUnimplementedAnalysisStoreServer()
|
||||
}
|
||||
|
||||
func RegisterAnalysisStoreServer(s grpc.ServiceRegistrar, srv AnalysisStoreServer) {
|
||||
// If the following call panics, it indicates UnimplementedAnalysisStoreServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AnalysisStore_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AnalysisStore_StoreAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StoreAuthReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisStoreServer).StoreAuth(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisStore_StoreAuth_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisStoreServer).StoreAuth(ctx, req.(*StoreAuthReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AnalysisStore_StoreAuthQrcode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StoreAuthQrcodeReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AnalysisStoreServer).StoreAuthQrcode(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AnalysisStore_StoreAuthQrcode_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AnalysisStoreServer).StoreAuthQrcode(ctx, req.(*StoreAuthQrcodeReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AnalysisStore_ServiceDesc is the grpc.ServiceDesc for AnalysisStore service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AnalysisStore_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "analysis.AnalysisStore",
|
||||
HandlerType: (*AnalysisStoreServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StoreAuth",
|
||||
Handler: _AnalysisStore_StoreAuth_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "StoreAuthQrcode",
|
||||
Handler: _AnalysisStore_StoreAuthQrcode_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "analysis/analysis.proto",
|
||||
}
|
||||
|
||||
// AnalysisDeviceClient is the client API for AnalysisDevice 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 AnalysisDeviceClient interface {
|
||||
}
|
||||
|
||||
type analysisDeviceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAnalysisDeviceClient(cc grpc.ClientConnInterface) AnalysisDeviceClient {
|
||||
return &analysisDeviceClient{cc}
|
||||
}
|
||||
|
||||
// AnalysisDeviceServer is the server API for AnalysisDevice service.
|
||||
// All implementations must embed UnimplementedAnalysisDeviceServer
|
||||
// for forward compatibility.
|
||||
type AnalysisDeviceServer interface {
|
||||
mustEmbedUnimplementedAnalysisDeviceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAnalysisDeviceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAnalysisDeviceServer struct{}
|
||||
|
||||
func (UnimplementedAnalysisDeviceServer) mustEmbedUnimplementedAnalysisDeviceServer() {}
|
||||
func (UnimplementedAnalysisDeviceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAnalysisDeviceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AnalysisDeviceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAnalysisDeviceServer interface {
|
||||
mustEmbedUnimplementedAnalysisDeviceServer()
|
||||
}
|
||||
|
||||
func RegisterAnalysisDeviceServer(s grpc.ServiceRegistrar, srv AnalysisDeviceServer) {
|
||||
// If the following call panics, it indicates UnimplementedAnalysisDeviceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AnalysisDevice_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
// AnalysisDevice_ServiceDesc is the grpc.ServiceDesc for AnalysisDevice service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AnalysisDevice_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "analysis.AnalysisDevice",
|
||||
HandlerType: (*AnalysisDeviceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "analysis/analysis.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user