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