MCPcopy Create free account
hub / github.com/apache/answer / UserChangeEmailVerify

Method UserChangeEmailVerify

internal/controller/user_controller.go:619–634  ·  view source on GitHub ↗

UserChangeEmailVerify user change email verification @Summary user change email verification @Description user change email verification @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UserChangeEmailVerifyReq true "UserChangeEmailVerifyReq" @Success 200 {object} h

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

617// @Success 200 {object} handler.RespBody{}
618// @Router /answer/api/v1/user/email [put]
619func (uc *UserController) UserChangeEmailVerify(ctx *gin.Context) {
620 req := &schema.UserChangeEmailVerifyReq{}
621 if handler.BindAndCheck(ctx, req) {
622 return
623 }
624 req.Content = uc.emailService.VerifyUrlExpired(ctx, req.Code)
625 if len(req.Content) == 0 {
626 handler.HandleResponse(ctx, errors.Forbidden(reason.EmailVerifyURLExpired),
627 &schema.ForbiddenResp{Type: schema.ForbiddenReasonTypeURLExpired})
628 return
629 }
630
631 resp, err := uc.userService.UserChangeEmailVerify(ctx, req.Content)
632 uc.actionService.ActionRecordDel(ctx, entity.CaptchaActionEmail, ctx.ClientIP())
633 handler.HandleResponse(ctx, err, resp)
634}
635
636// UserRanking get user ranking
637// @Summary get user ranking

Callers

nothing calls this directly

Calls 4

BindAndCheckFunction · 0.92
HandleResponseFunction · 0.92
VerifyUrlExpiredMethod · 0.80
ActionRecordDelMethod · 0.80

Tested by

no test coverage detected