Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

style: formatting naming

LinkinStar8232e1ec2d55
diff --git a/internal/controller/user_controller.go b/internal/controller/user_controller.go
index b4976cc3..4f2a9b63 100644
--- a/internal/controller/user_controller.go
+++ b/internal/controller/user_controller.go
@@ -491,7 +491,7 @@ func (uc *UserController) UserChangeEmailSendCode(ctx *gin.Context) {
// If the user is not logged in, the api cannot be used.
// If the user email is not verified, that also can use this api to modify the email.
- captchaPass := uc.actionService.ActionRecordVerifyCaptcha(ctx, schema.ActionRecord_Type_Email, ctx.ClientIP(), req.CaptchaID, req.CaptchaCode)
+ captchaPass := uc.actionService.ActionRecordVerifyCaptcha(ctx, schema.ActionRecordTypeEmail, ctx.ClientIP(), req.CaptchaID, req.CaptchaCode)
if !captchaPass {
resp := schema.UserVerifyEmailErrorResponse{
Key: "captcha_code",
@@ -506,7 +506,7 @@ func (uc *UserController) UserChangeEmailSendCode(ctx *gin.Context) {
handler.HandleResponse(ctx, errors.Unauthorized(reason.UnauthorizedError), nil)
return
}
- _, _ = uc.actionService.ActionRecordAdd(ctx, schema.ActionRecord_Type_Email, ctx.ClientIP())
+ _, _ = uc.actionService.ActionRecordAdd(ctx, schema.ActionRecordTypeEmail, ctx.ClientIP())
err := uc.userService.UserChangeEmailSendCode(ctx, req)
handler.HandleResponse(ctx, err, nil)
}
@@ -534,6 +534,6 @@ func (uc *UserController) UserChangeEmailVerify(ctx *gin.Context) {
}
err := uc.userService.UserChangeEmailVerify(ctx, req.Content)
- uc.actionService.ActionRecordDel(ctx, schema.ActionRecord_Type_Email, ctx.ClientIP())
+ uc.actionService.ActionRecordDel(ctx, schema.ActionRecordTypeEmail, ctx.ClientIP())
handler.HandleResponse(ctx, err, nil)
}
diff --git a/internal/service/user_service.go b/internal/service/user_service.go
index ff1ebea9..472ff061 100644
--- a/internal/service/user_service.go
+++ b/internal/service/user_service.go
@@ -516,9 +516,9 @@ func (us *UserService) UserChangeEmailSendCode(ctx context.Context, req *schema.
var title, body string
verifyEmailURL := fmt.Sprintf("%s/users/confirm-new-email?code=%s", us.serviceConfig.WebHost, code)
if userInfo.MailStatus == entity.EmailStatusToBeVerified {
- title, body, err = us.emailService.RegisterTemplate(ctx, verifyEmailUrl)
+ title, body, err = us.emailService.RegisterTemplate(ctx, verifyEmailURL)
} else {
- title, body, err = us.emailService.ChangeEmailTemplate(ctx, verifyEmailUrl)
+ title, body, err = us.emailService.ChangeEmailTemplate(ctx, verifyEmailURL)
}
if err != nil {
return err