silvermobi/servers/grpcapi/server/forget_password.go

28 lines
720 B
Go

package grpcserver
import (
"context"
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
"github.com/rs/zerolog/log"
)
func (s SilvermobiGRPCService) ForgetAccount(ctx context.Context, req *grpcproto.ForgetAccountRequest) (res *grpcproto.ForgetAccountResponse, err error) {
log.Info().
Str("username", req.Username).
Str("namespace", req.Namespace).
Msg("ForgetAccount")
response, access_code := s.Handler.ForgetAccount(ctx, req.Username, req.Namespace)
if response == true {
return &grpcproto.ForgetAccountResponse{
Response: true,
AccessCode: access_code,
}, nil
} else {
return &grpcproto.ForgetAccountResponse{
Response: false,
AccessCode: "",
}, nil
}
}