(c *gin.Context)
| 398 | } |
| 399 | |
| 400 | func GetSelf(c *gin.Context) { |
| 401 | id := c.GetInt("id") |
| 402 | user, err := model.GetUserById(id, false) |
| 403 | if err != nil { |
| 404 | common.ApiError(c, err) |
| 405 | return |
| 406 | } |
| 407 | // Hide admin remarks: set to empty to trigger omitempty tag, ensuring the remark field is not included in JSON returned to regular users |
| 408 | user.Remark = "" |
| 409 | |
| 410 | c.JSON(http.StatusOK, gin.H{ |
| 411 | "success": true, |
| 412 | "message": "", |
| 413 | "data": user, |
| 414 | }) |
| 415 | return |
| 416 | } |
| 417 | |
| 418 | func GetUserModels(c *gin.Context) { |
| 419 | id, err := strconv.Atoi(c.Param("id")) |
nothing calls this directly
no test coverage detected