add full auth

This commit is contained in:
2026-07-06 15:56:10 +07:00
parent 434627d61a
commit 6be4142487
14 changed files with 1512 additions and 50 deletions
+38
View File
@@ -25,6 +25,7 @@ const (
EveningDetectiveServer_RefreshPassword_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/RefreshPassword"
EveningDetectiveServer_Login_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Login"
EveningDetectiveServer_Refresh_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Refresh"
EveningDetectiveServer_GetUsers_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetUsers"
)
// EveningDetectiveServerClient is the client API for EveningDetectiveServer service.
@@ -37,6 +38,7 @@ type EveningDetectiveServerClient interface {
RefreshPassword(ctx context.Context, in *RefreshPasswordReq, opts ...grpc.CallOption) (*RefreshPasswordRsp, error)
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginRsp, error)
Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshRsp, error)
GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersRsp, error)
}
type eveningDetectiveServerClient struct {
@@ -107,6 +109,16 @@ func (c *eveningDetectiveServerClient) Refresh(ctx context.Context, in *RefreshR
return out, nil
}
func (c *eveningDetectiveServerClient) GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUsersRsp)
err := c.cc.Invoke(ctx, EveningDetectiveServer_GetUsers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// EveningDetectiveServerServer is the server API for EveningDetectiveServer service.
// All implementations must embed UnimplementedEveningDetectiveServerServer
// for forward compatibility.
@@ -117,6 +129,7 @@ type EveningDetectiveServerServer interface {
RefreshPassword(context.Context, *RefreshPasswordReq) (*RefreshPasswordRsp, error)
Login(context.Context, *LoginReq) (*LoginRsp, error)
Refresh(context.Context, *RefreshReq) (*RefreshRsp, error)
GetUsers(context.Context, *GetUsersReq) (*GetUsersRsp, error)
mustEmbedUnimplementedEveningDetectiveServerServer()
}
@@ -145,6 +158,9 @@ func (UnimplementedEveningDetectiveServerServer) Login(context.Context, *LoginRe
func (UnimplementedEveningDetectiveServerServer) Refresh(context.Context, *RefreshReq) (*RefreshRsp, error) {
return nil, status.Error(codes.Unimplemented, "method Refresh not implemented")
}
func (UnimplementedEveningDetectiveServerServer) GetUsers(context.Context, *GetUsersReq) (*GetUsersRsp, error) {
return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented")
}
func (UnimplementedEveningDetectiveServerServer) mustEmbedUnimplementedEveningDetectiveServerServer() {
}
func (UnimplementedEveningDetectiveServerServer) testEmbeddedByValue() {}
@@ -275,6 +291,24 @@ func _EveningDetectiveServer_Refresh_Handler(srv interface{}, ctx context.Contex
return interceptor(ctx, in, info, handler)
}
func _EveningDetectiveServer_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUsersReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EveningDetectiveServerServer).GetUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EveningDetectiveServer_GetUsers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EveningDetectiveServerServer).GetUsers(ctx, req.(*GetUsersReq))
}
return interceptor(ctx, in, info, handler)
}
// EveningDetectiveServer_ServiceDesc is the grpc.ServiceDesc for EveningDetectiveServer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -306,6 +340,10 @@ var EveningDetectiveServer_ServiceDesc = grpc.ServiceDesc{
MethodName: "Refresh",
Handler: _EveningDetectiveServer_Refresh_Handler,
},
{
MethodName: "GetUsers",
Handler: _EveningDetectiveServer_GetUsers_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "main.proto",