diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java b/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java index 4663c0b3..d78c5791 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighUserController.java @@ -96,7 +96,7 @@ public class HighUserController { @RequestMapping(value = "/forbiddenUser", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "禁用账号") - public ResponseData updatePosition(@RequestParam(value = "userId" , required = true) Long userId) { + public ResponseData forbiddenUser(@RequestParam(value = "userId" , required = true) Long userId) { try { HighUser highUser = highUserService.findByUserId(userId); @@ -106,7 +106,38 @@ public class HighUserController { throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, ""); } - + highUser.setStatus(0); + + highUserService.updateUser(highUser); + + return ResponseMsgUtil.success("禁用成功"); + + } catch (Exception e) { + log.error("BsPositionController --> addPosition() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateUser", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改用户") + public ResponseData updateUser(@RequestBody HighUser reqBody) { + try { + + if ( + reqBody.getId() == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + HighUser highUser = highUserService.findByUserId(reqBody.getId()); + + if (highUser == null) { + log.error("HighUserController --> updateUser() error!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, ""); + } + + highUserService.updateUser(reqBody); return ResponseMsgUtil.success("修改成功");