MCPcopy Index your code
hub / github.com/apache/answer / ActionRecord

Method ActionRecord

internal/controller/user_controller.go:493–512  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

491// @Success 200 {object} handler.RespBody{data=schema.ActionRecordResp}
492// @Router /answer/api/v1/user/action/record [get]
493func (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

Callers

nothing calls this directly

Calls 4

BindAndCheckFunction · 0.92
GetUserInfoFromContextFunction · 0.92
GetUserIsAdminModeratorFunction · 0.92
HandleResponseFunction · 0.92

Tested by

no test coverage detected