UserVerifyEmail godoc @Summary UserVerifyEmail @Description UserVerifyEmail @Tags User @Accept json @Produce json @Param code query string true "code" default() @Success 200 {object} handler.RespBody{data=schema.UserLoginResp} @Router /answer/api/v1/user/email/verification [post]
(ctx *gin.Context)
| 315 | // @Success 200 {object} handler.RespBody{data=schema.UserLoginResp} |
| 316 | // @Router /answer/api/v1/user/email/verification [post] |
| 317 | func (uc *UserController) UserVerifyEmail(ctx *gin.Context) { |
| 318 | req := &schema.UserVerifyEmailReq{} |
| 319 | if handler.BindAndCheck(ctx, req) { |
| 320 | return |
| 321 | } |
| 322 | |
| 323 | req.Content = uc.emailService.VerifyUrlExpired(ctx, req.Code) |
| 324 | if len(req.Content) == 0 { |
| 325 | handler.HandleResponse(ctx, errors.Forbidden(reason.EmailVerifyURLExpired), |
| 326 | &schema.ForbiddenResp{Type: schema.ForbiddenReasonTypeURLExpired}) |
| 327 | return |
| 328 | } |
| 329 | |
| 330 | resp, err := uc.userService.UserVerifyEmail(ctx, req) |
| 331 | if err != nil { |
| 332 | handler.HandleResponse(ctx, err, nil) |
| 333 | return |
| 334 | } |
| 335 | |
| 336 | uc.actionService.ActionRecordDel(ctx, entity.CaptchaActionEmail, ctx.ClientIP()) |
| 337 | handler.HandleResponse(ctx, err, resp) |
| 338 | } |
| 339 | |
| 340 | // UserVerifyEmailSend godoc |
| 341 | // @Summary UserVerifyEmailSend |
nothing calls this directly
no test coverage detected