UpdateProfile 更新用户资料(管理员)
(ctx *gin.Context)
| 352 | |
| 353 | // UpdateProfile 更新用户资料(管理员) |
| 354 | func (uh *UserHandler) UpdateProfile(ctx *gin.Context) { |
| 355 | var req req.UpdateProfileAdminReq |
| 356 | if err := ctx.ShouldBindJSON(&req); err != nil { |
| 357 | apiresponse.ErrorWithMessage(ctx, "无效的请求参数") |
| 358 | return |
| 359 | } |
| 360 | |
| 361 | err := uh.svc.UpdateProfileAdmin(ctx, domain.Profile{ |
| 362 | RealName: req.RealName, |
| 363 | Avatar: req.Avatar, |
| 364 | About: req.About, |
| 365 | Birthday: req.Birthday, |
| 366 | Phone: &req.Phone, |
| 367 | UserID: req.UserID, |
| 368 | }) |
| 369 | if err != nil { |
| 370 | apiresponse.ErrorWithMessage(ctx, UserProfileUpdateFailure) |
| 371 | return |
| 372 | } |
| 373 | |
| 374 | apiresponse.Success(ctx) |
| 375 | } |
nothing calls this directly
no test coverage detected