ActionRecord godoc @Summary ActionRecord @Description ActionRecord @Tags User @Param action query string true "action" Enums(login, e_mail, find_pass) @Security ApiKeyAuth @Success 200 {object} handler.RespBody{data=schema.ActionRecordResp} @Router /answer/api/v1/user/action/record [get]
(ctx *gin.Context)
| 491 | // @Success 200 {object} handler.RespBody{data=schema.ActionRecordResp} |
| 492 | // @Router /answer/api/v1/user/action/record [get] |
| 493 | func (uc *UserController) ActionRecord(ctx *gin.Context) { |
| 494 | req := &schema.ActionRecordReq{} |
| 495 | if handler.BindAndCheck(ctx, req) { |
| 496 | return |
| 497 | } |
| 498 | userinfo := middleware.GetUserInfoFromContext(ctx) |
| 499 | if userinfo != nil { |
| 500 | req.UserID = userinfo.UserID |
| 501 | } |
| 502 | req.IP = ctx.ClientIP() |
| 503 | resp := &schema.ActionRecordResp{} |
| 504 | isAdmin := middleware.GetUserIsAdminModerator(ctx) |
| 505 | if isAdmin { |
| 506 | resp.Verify = false |
| 507 | handler.HandleResponse(ctx, nil, resp) |
| 508 | } else { |
| 509 | resp, err := uc.actionService.ActionRecord(ctx, req) |
| 510 | handler.HandleResponse(ctx, err, resp) |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | // GetUserNotificationConfig get user's notification config |
| 515 | // @Summary get user's notification config |
nothing calls this directly
no test coverage detected