新增用户修改

dev-discount
yuanye 4 years ago
parent 0d491e1591
commit 5cfe859df5
  1. 35
      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("修改成功");

Loading…
Cancel
Save