mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
@@ -54,6 +54,7 @@ type UserService interface {
|
||||
SendVerificationEmail(ctx context.Context, in *SendVerificationEmailRequest, opts ...client.CallOption) (*SendVerificationEmailResponse, error)
|
||||
SendPasswordResetEmail(ctx context.Context, in *SendPasswordResetEmailRequest, opts ...client.CallOption) (*SendPasswordResetEmailResponse, error)
|
||||
ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...client.CallOption) (*ResetPasswordResponse, error)
|
||||
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
|
||||
}
|
||||
|
||||
type userService struct {
|
||||
@@ -188,6 +189,16 @@ func (c *userService) ResetPassword(ctx context.Context, in *ResetPasswordReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "User.List", in)
|
||||
out := new(ListResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for User service
|
||||
|
||||
type UserHandler interface {
|
||||
@@ -203,6 +214,7 @@ type UserHandler interface {
|
||||
SendVerificationEmail(context.Context, *SendVerificationEmailRequest, *SendVerificationEmailResponse) error
|
||||
SendPasswordResetEmail(context.Context, *SendPasswordResetEmailRequest, *SendPasswordResetEmailResponse) error
|
||||
ResetPassword(context.Context, *ResetPasswordRequest, *ResetPasswordResponse) error
|
||||
List(context.Context, *ListRequest, *ListResponse) error
|
||||
}
|
||||
|
||||
func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.HandlerOption) error {
|
||||
@@ -219,6 +231,7 @@ func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.Handl
|
||||
SendVerificationEmail(ctx context.Context, in *SendVerificationEmailRequest, out *SendVerificationEmailResponse) error
|
||||
SendPasswordResetEmail(ctx context.Context, in *SendPasswordResetEmailRequest, out *SendPasswordResetEmailResponse) error
|
||||
ResetPassword(ctx context.Context, in *ResetPasswordRequest, out *ResetPasswordResponse) error
|
||||
List(ctx context.Context, in *ListRequest, out *ListResponse) error
|
||||
}
|
||||
type User struct {
|
||||
user
|
||||
@@ -278,3 +291,7 @@ func (h *userHandler) SendPasswordResetEmail(ctx context.Context, in *SendPasswo
|
||||
func (h *userHandler) ResetPassword(ctx context.Context, in *ResetPasswordRequest, out *ResetPasswordResponse) error {
|
||||
return h.UserHandler.ResetPassword(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *userHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error {
|
||||
return h.UserHandler.List(ctx, in, out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user