diff --git a/src/main/java/com/juzi/oerp/controller/admin/UserController.java b/src/main/java/com/juzi/oerp/controller/admin/UserController.java index 71bb17e..1cff303 100644 --- a/src/main/java/com/juzi/oerp/controller/admin/UserController.java +++ b/src/main/java/com/juzi/oerp/controller/admin/UserController.java @@ -5,7 +5,6 @@ import com.juzi.oerp.model.dto.UpdateUserDTO; import com.juzi.oerp.model.dto.param.PageParamDTO; import com.juzi.oerp.model.vo.UserInfoVO; -import com.juzi.oerp.model.vo.response.DeleteResponseVO; import com.juzi.oerp.model.vo.response.MessageResponseVO; import com.juzi.oerp.model.vo.response.ResponseVO; import com.juzi.oerp.service.UserService; @@ -67,9 +66,9 @@ public ResponseVO getUserByUserId(@PathVariable Integer userId) { */ @DeleteMapping("/{userId}") @ApiOperation("删除用户") - public ResponseVO deleteUserByUserId(@PathVariable Integer userId) { + public MessageResponseVO deleteUserByUserId(@PathVariable Integer userId) { userService.deleteUserByUserId(userId); - return new DeleteResponseVO(); + return new MessageResponseVO(20012); } /** diff --git a/src/main/java/com/juzi/oerp/controller/user/UserController.java b/src/main/java/com/juzi/oerp/controller/user/UserController.java index 7ffd79f..6fc2a37 100644 --- a/src/main/java/com/juzi/oerp/controller/user/UserController.java +++ b/src/main/java/com/juzi/oerp/controller/user/UserController.java @@ -2,12 +2,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.juzi.oerp.common.store.LocalUserStore; -import com.juzi.oerp.model.dto.UpdateUserInfoDTO; import com.juzi.oerp.model.dto.param.PageParamDTO; +import com.juzi.oerp.model.dto.param.UpdateUserInfoParamDTO; import com.juzi.oerp.model.po.UserInfoPO; import com.juzi.oerp.model.po.UserPO; -import com.juzi.oerp.model.vo.UserInfoVO; import com.juzi.oerp.model.vo.UserApplyExamVO; +import com.juzi.oerp.model.vo.UserInfoVO; import com.juzi.oerp.model.vo.response.ResponseVO; import com.juzi.oerp.model.vo.response.UpdatedResponseVO; import com.juzi.oerp.service.UserInfoService; @@ -26,7 +26,7 @@ * @author Juzi * @date 2020/7/19 20:48 */ -@Api(tags = "用户信息") +@Api(tags = "个人中心") @RequestMapping("/user") @RestController("userUserController") public class UserController { @@ -38,7 +38,7 @@ public class UserController { private UserService userService; @GetMapping - @ApiOperation(value = "个人信息", notes = "获取当前已登录用户的个人信息") + @ApiOperation(value = "获取个人信息", notes = "获取当前已登录用户的个人信息") public ResponseVO getUserInfo() { Integer userId = LocalUserStore.getLocalUser(); UserPO userPO = userService.getById(userId); @@ -47,18 +47,19 @@ public ResponseVO getUserInfo() { } @PutMapping - @ApiOperation(value = "修改个人信息") - public UpdatedResponseVO updateUserInfo(@RequestBody UpdateUserInfoDTO updateUserInfoDTO) { + @ApiOperation("修改个人信息") + public UpdatedResponseVO updateUserInfo(@RequestBody UpdateUserInfoParamDTO updateUserInfoParamDTO) { Integer userId = LocalUserStore.getLocalUser(); UserInfoPO userInfoPO = new UserInfoPO(); userInfoPO.setUserId(userId); - BeanUtils.copyProperties(updateUserInfoDTO, userInfoPO); + BeanUtils.copyProperties(updateUserInfoParamDTO, userInfoPO); userInfoService.updateById(userInfoPO); return new UpdatedResponseVO(); } @GetMapping("/apply") + @ApiOperation("获取报名信息") public ResponseVO> getUserApplyExam(@RequestBody PageParamDTO pageParamDTO){ Page result = userInfoService.queryUserApplyExam(pageParamDTO); return new ResponseVO<>(result); diff --git a/src/main/java/com/juzi/oerp/model/dto/UpdateUserInfoDTO.java b/src/main/java/com/juzi/oerp/model/dto/param/UpdateUserInfoParamDTO.java similarity index 78% rename from src/main/java/com/juzi/oerp/model/dto/UpdateUserInfoDTO.java rename to src/main/java/com/juzi/oerp/model/dto/param/UpdateUserInfoParamDTO.java index 455da34..3a94784 100644 --- a/src/main/java/com/juzi/oerp/model/dto/UpdateUserInfoDTO.java +++ b/src/main/java/com/juzi/oerp/model/dto/param/UpdateUserInfoParamDTO.java @@ -1,4 +1,4 @@ -package com.juzi.oerp.model.dto; +package com.juzi.oerp.model.dto.param; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -12,7 +12,7 @@ */ @Data @ApiModel(description = "修改用户信息参数") -public class UpdateUserInfoDTO { +public class UpdateUserInfoParamDTO { @ApiModelProperty("姓名") private String name; @@ -23,6 +23,9 @@ public class UpdateUserInfoDTO { @ApiModelProperty("性别") private Integer gender; + @ApiModelProperty("学校") + private String school; + @ApiModelProperty("学历") private String education; diff --git a/src/main/java/com/juzi/oerp/model/po/UserInfoPO.java b/src/main/java/com/juzi/oerp/model/po/UserInfoPO.java index c6d14e2..c9a7776 100644 --- a/src/main/java/com/juzi/oerp/model/po/UserInfoPO.java +++ b/src/main/java/com/juzi/oerp/model/po/UserInfoPO.java @@ -46,6 +46,9 @@ public class UserInfoPO { @ApiModelProperty("身份证号码") private String identityNo; + @ApiModelProperty("学校") + private String school; + @ApiModelProperty("学历") private String education; diff --git a/src/main/java/com/juzi/oerp/model/vo/UserInfoVO.java b/src/main/java/com/juzi/oerp/model/vo/UserInfoVO.java index 9ced169..b9d4c37 100644 --- a/src/main/java/com/juzi/oerp/model/vo/UserInfoVO.java +++ b/src/main/java/com/juzi/oerp/model/vo/UserInfoVO.java @@ -36,6 +36,9 @@ public class UserInfoVO { @ApiModelProperty("性别") private Integer gender; + @ApiModelProperty("学校") + private String school; + @ApiModelProperty("学历") private String education; diff --git a/src/main/resources/code-message.properties b/src/main/resources/code-message.properties index 5f05421..b7420cd 100644 --- a/src/main/resources/code-message.properties +++ b/src/main/resources/code-message.properties @@ -9,6 +9,7 @@ codeMessage[20008]=\u624B\u673A\u53F7\u6B63\u786E codeMessage[20009]=\u624B\u673A\u53F7\u5DF2\u9A8C\u8BC1 codeMessage[20010]=\u4FEE\u6539\u6210\u529F codeMessage[20011]=\u521B\u5EFA\u6210\u529F +codeMessage[20012]=\u5220\u9664\u6210\u529F codeMessage[40001]=\u624B\u673A\u53F7\u5DF2\u88AB\u6CE8\u518C\uFF0C\u8BF7\u66F4\u6362\u624B\u673A\u53F7\u518D\u8BD5 diff --git a/src/main/resources/mybatis/xml/dao/UserDAO.xml b/src/main/resources/mybatis/xml/dao/UserDAO.xml index 056a2ff..89eb82c 100644 --- a/src/main/resources/mybatis/xml/dao/UserDAO.xml +++ b/src/main/resources/mybatis/xml/dao/UserDAO.xml @@ -14,7 +14,8 @@ user_info.avatar_url, user_info.`name`, user_info.gender, - user_info.education, + user_info.school, + user_info.education, user_info.identity_no, user_info.birthday FROM @@ -31,26 +32,28 @@