Commit 11402e14125ff90f5f5e36ece6f0ee4648da86d9

Authored by YunaiV
1 parent 10397aa4

【功能优化】SYSTEM:updateUserProfile 接口,增加 avatar 参数,逐步替代掉 updateUserAvatar 接口

yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java
... ... @@ -79,6 +79,7 @@ public class UserProfileController {
79 79 return success(true);
80 80 }
81 81  
  82 + @Deprecated // TODO @芋艿:逐步替换到 updateUserProfile 接口
82 83 @RequestMapping(value = "/update-avatar",
83 84 method = {RequestMethod.POST, RequestMethod.PUT}) // 解决 uni-app 不支持 Put 上传文件的问题
84 85 @Operation(summary = "上传用户个人头像")
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java
... ... @@ -6,13 +6,14 @@ import org.hibernate.validator.constraints.Length;
6 6  
7 7 import jakarta.validation.constraints.Email;
8 8 import jakarta.validation.constraints.Size;
  9 +import org.hibernate.validator.constraints.URL;
9 10  
10 11  
11 12 @Schema(description = "管理后台 - 用户个人信息更新 Request VO")
12 13 @Data
13 14 public class UserProfileUpdateReqVO {
14 15  
15   - @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
  16 + @Schema(description = "用户昵称", example = "芋艿")
16 17 @Size(max = 30, message = "用户昵称长度不能超过 30 个字符")
17 18 private String nickname;
18 19  
... ... @@ -28,4 +29,8 @@ public class UserProfileUpdateReqVO {
28 29 @Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1")
29 30 private Integer sex;
30 31  
  32 + @Schema(description = "角色头像", example = "https://www.iocoder.cn/1.png")
  33 + @URL(message = "头像地址格式不正确")
  34 + private String avatar;
  35 +
31 36 }
... ...