add refresh-password route

This commit is contained in:
2026-06-30 21:06:51 +07:00
parent 4d9b73cb34
commit d22ad7cb09
9 changed files with 366 additions and 28 deletions
+41 -3
View File
@@ -19,9 +19,10 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
EveningDetectiveServer_Ping_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Ping"
EveningDetectiveServer_Echo_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Echo"
EveningDetectiveServer_Signup_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Signup"
EveningDetectiveServer_Ping_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Ping"
EveningDetectiveServer_Echo_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Echo"
EveningDetectiveServer_Signup_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/Signup"
EveningDetectiveServer_RefreshPassword_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/RefreshPassword"
)
// EveningDetectiveServerClient is the client API for EveningDetectiveServer service.
@@ -31,6 +32,7 @@ type EveningDetectiveServerClient interface {
Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingRsp, error)
Echo(ctx context.Context, in *EchoReq, opts ...grpc.CallOption) (*EchoRsp, error)
Signup(ctx context.Context, in *SignupReq, opts ...grpc.CallOption) (*SignupRsp, error)
RefreshPassword(ctx context.Context, in *RefreshPasswordReq, opts ...grpc.CallOption) (*RefreshPasswordRsp, error)
}
type eveningDetectiveServerClient struct {
@@ -71,6 +73,16 @@ func (c *eveningDetectiveServerClient) Signup(ctx context.Context, in *SignupReq
return out, nil
}
func (c *eveningDetectiveServerClient) RefreshPassword(ctx context.Context, in *RefreshPasswordReq, opts ...grpc.CallOption) (*RefreshPasswordRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RefreshPasswordRsp)
err := c.cc.Invoke(ctx, EveningDetectiveServer_RefreshPassword_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.
@@ -78,6 +90,7 @@ type EveningDetectiveServerServer interface {
Ping(context.Context, *PingReq) (*PingRsp, error)
Echo(context.Context, *EchoReq) (*EchoRsp, error)
Signup(context.Context, *SignupReq) (*SignupRsp, error)
RefreshPassword(context.Context, *RefreshPasswordReq) (*RefreshPasswordRsp, error)
mustEmbedUnimplementedEveningDetectiveServerServer()
}
@@ -97,6 +110,9 @@ func (UnimplementedEveningDetectiveServerServer) Echo(context.Context, *EchoReq)
func (UnimplementedEveningDetectiveServerServer) Signup(context.Context, *SignupReq) (*SignupRsp, error) {
return nil, status.Error(codes.Unimplemented, "method Signup not implemented")
}
func (UnimplementedEveningDetectiveServerServer) RefreshPassword(context.Context, *RefreshPasswordReq) (*RefreshPasswordRsp, error) {
return nil, status.Error(codes.Unimplemented, "method RefreshPassword not implemented")
}
func (UnimplementedEveningDetectiveServerServer) mustEmbedUnimplementedEveningDetectiveServerServer() {
}
func (UnimplementedEveningDetectiveServerServer) testEmbeddedByValue() {}
@@ -173,6 +189,24 @@ func _EveningDetectiveServer_Signup_Handler(srv interface{}, ctx context.Context
return interceptor(ctx, in, info, handler)
}
func _EveningDetectiveServer_RefreshPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RefreshPasswordReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EveningDetectiveServerServer).RefreshPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EveningDetectiveServer_RefreshPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EveningDetectiveServerServer).RefreshPassword(ctx, req.(*RefreshPasswordReq))
}
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)
@@ -192,6 +226,10 @@ var EveningDetectiveServer_ServiceDesc = grpc.ServiceDesc{
MethodName: "Signup",
Handler: _EveningDetectiveServer_Signup_Handler,
},
{
MethodName: "RefreshPassword",
Handler: _EveningDetectiveServer_RefreshPassword_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "main.proto",