@Id GetCurrentUserV2 @Description get current user. @Tags user @Security ApiKeyAuth @Success 200 {object} models.CurrentUserResp @Router /v2/user/current_user [get]
(c echo.Context)
| 311 | // @Success 200 {object} models.CurrentUserResp |
| 312 | // @Router /v2/user/current_user [get] |
| 313 | func GetCurrentUserV2(c echo.Context) error { |
| 314 | user, err := getCurrentUser(c) |
| 315 | if err != nil { |
| 316 | return c.JSON(http.StatusInternalServerError, models.BuildBaseResp(fmt.Errorf("invalid params:\n%v", err))) |
| 317 | } |
| 318 | user.Password = "*" |
| 319 | return c.JSON(http.StatusOK, &models.CurrentUserResp{ |
| 320 | CurrentUser: user, |
| 321 | BaseResp: models.BuildBaseResp(nil), |
| 322 | }) |
| 323 | } |
| 324 | |
| 325 | func getCurrentUser(c echo.Context) (*common.User, error) { |
| 326 | logger := handler.NewLogger().Named("getCurrentUser") |
nothing calls this directly
no test coverage detected