update refresh

This commit is contained in:
2026-07-06 12:58:27 +07:00
parent e4007eb15a
commit 57687d1d62
15 changed files with 483 additions and 66 deletions
+38
View File
@@ -24,6 +24,7 @@ const (
EveningDetectiveServer_Signup_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Signup"
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"
)
// EveningDetectiveServerClient is the client API for EveningDetectiveServer service.
@@ -35,6 +36,7 @@ type EveningDetectiveServerClient interface {
Signup(ctx context.Context, in *SignupReq, opts ...grpc.CallOption) (*SignupRsp, error)
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)
}
type eveningDetectiveServerClient struct {
@@ -95,6 +97,16 @@ func (c *eveningDetectiveServerClient) Login(ctx context.Context, in *LoginReq,
return out, nil
}
func (c *eveningDetectiveServerClient) Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RefreshRsp)
err := c.cc.Invoke(ctx, EveningDetectiveServer_Refresh_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.
@@ -104,6 +116,7 @@ type EveningDetectiveServerServer interface {
Signup(context.Context, *SignupReq) (*SignupRsp, error)
RefreshPassword(context.Context, *RefreshPasswordReq) (*RefreshPasswordRsp, error)
Login(context.Context, *LoginReq) (*LoginRsp, error)
Refresh(context.Context, *RefreshReq) (*RefreshRsp, error)
mustEmbedUnimplementedEveningDetectiveServerServer()
}
@@ -129,6 +142,9 @@ func (UnimplementedEveningDetectiveServerServer) RefreshPassword(context.Context
func (UnimplementedEveningDetectiveServerServer) Login(context.Context, *LoginReq) (*LoginRsp, error) {
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
}
func (UnimplementedEveningDetectiveServerServer) Refresh(context.Context, *RefreshReq) (*RefreshRsp, error) {
return nil, status.Error(codes.Unimplemented, "method Refresh not implemented")
}
func (UnimplementedEveningDetectiveServerServer) mustEmbedUnimplementedEveningDetectiveServerServer() {
}
func (UnimplementedEveningDetectiveServerServer) testEmbeddedByValue() {}
@@ -241,6 +257,24 @@ func _EveningDetectiveServer_Login_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _EveningDetectiveServer_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RefreshReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EveningDetectiveServerServer).Refresh(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EveningDetectiveServer_Refresh_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EveningDetectiveServerServer).Refresh(ctx, req.(*RefreshReq))
}
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)
@@ -268,6 +302,10 @@ var EveningDetectiveServer_ServiceDesc = grpc.ServiceDesc{
MethodName: "Login",
Handler: _EveningDetectiveServer_Login_Handler,
},
{
MethodName: "Refresh",
Handler: _EveningDetectiveServer_Refresh_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "main.proto",