From 5cfe859df5a7d442b22fded2a5756ed37157b490 Mon Sep 17 00:00:00 2001 From: yuanye Date: Tue, 9 Mar 2021 18:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighUserController.java | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) 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("修改成功");