Commit 8297d94b51dc5dc8efe4567647de14238f0f6371
1 parent
2dd87e04
增加 个人信息设置 功能
Showing
1 changed file
with
1 additions
and
21 deletions
src/main/java/cn/iocoder/dashboard/modules/system/controller/user/SysUserProfileController.java
| 1 | 1 | package cn.iocoder.dashboard.modules.system.controller.user; |
| 2 | 2 | |
| 3 | -import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil; | |
| 4 | 3 | import cn.iocoder.dashboard.common.pojo.CommonResult; |
| 5 | 4 | import cn.iocoder.dashboard.framework.security.core.LoginUser; |
| 6 | 5 | import cn.iocoder.dashboard.framework.security.core.util.SecurityFrameworkUtils; |
| ... | ... | @@ -31,7 +30,6 @@ import java.io.IOException; |
| 31 | 30 | import java.util.List; |
| 32 | 31 | |
| 33 | 32 | import static cn.iocoder.dashboard.common.pojo.CommonResult.success; |
| 34 | -import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.FILE_UPLOAD_FAILED; | |
| 35 | 33 | |
| 36 | 34 | /** |
| 37 | 35 | * @author niudehua |
| ... | ... | @@ -49,11 +47,6 @@ public class SysUserProfileController { |
| 49 | 47 | @Resource |
| 50 | 48 | private SysRoleService roleService; |
| 51 | 49 | |
| 52 | - /** | |
| 53 | - * 个人信息 | |
| 54 | - * | |
| 55 | - * @return 个人信息详情 | |
| 56 | - */ | |
| 57 | 50 | @GetMapping("/get") |
| 58 | 51 | @ApiOperation("获得登录用户信息") |
| 59 | 52 | public CommonResult<SysUserProfileRespVO> profile() { |
| ... | ... | @@ -67,13 +60,6 @@ public class SysUserProfileController { |
| 67 | 60 | return success(userProfileRespVO); |
| 68 | 61 | } |
| 69 | 62 | |
| 70 | - /** | |
| 71 | - * 修改个人信息 | |
| 72 | - * | |
| 73 | - * @param reqVO 个人信息更新 reqVO | |
| 74 | - * @param request HttpServletRequest | |
| 75 | - * @return 修改结果 | |
| 76 | - */ | |
| 77 | 63 | @PostMapping("/update") |
| 78 | 64 | @ApiOperation("修改用户个人信息") |
| 79 | 65 | public CommonResult<Boolean> updateProfile(@RequestBody SysUserProfileUpdateReqVO reqVO, HttpServletRequest request) { |
| ... | ... | @@ -82,12 +68,6 @@ public class SysUserProfileController { |
| 82 | 68 | return success(true); |
| 83 | 69 | } |
| 84 | 70 | |
| 85 | - /** | |
| 86 | - * 上传用户个人头像 | |
| 87 | - * | |
| 88 | - * @param file 头像文件 | |
| 89 | - * @return 上传结果 | |
| 90 | - */ | |
| 91 | 71 | @PostMapping("/upload-avatar") |
| 92 | 72 | @ApiOperation("上传用户个人头像") |
| 93 | 73 | public CommonResult<Boolean> uploadAvatar(@RequestParam("avatarFile") MultipartFile file) { |
| ... | ... | @@ -99,7 +79,7 @@ public class SysUserProfileController { |
| 99 | 79 | } |
| 100 | 80 | } catch (IOException e) { |
| 101 | 81 | log.error("文件上传失败", e); |
| 102 | - throw ServiceExceptionUtil.exception(FILE_UPLOAD_FAILED); | |
| 82 | + throw new RuntimeException(e); | |
| 103 | 83 | } |
| 104 | 84 | } |
| 105 | 85 | return success(false); | ... | ... |