|
|
|
@ -66,6 +66,17 @@ public class UserController {
|
|
|
|
|
return R.data(UserWrapper.build().entityVO(detail)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询单条 |
|
|
|
|
*/ |
|
|
|
|
@ApiOperationSupport(order =2) |
|
|
|
|
@ApiOperation(value = "查看详情", notes = "传入id") |
|
|
|
|
@GetMapping("/info") |
|
|
|
|
public R<UserVO> info(BladeUser user) { |
|
|
|
|
User detail = userService.getById(user.getUserId()); |
|
|
|
|
return R.data(UserWrapper.build().entityVO(detail)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 用户列表 |
|
|
|
|
*/ |
|
|
|
@ -74,7 +85,7 @@ public class UserController {
|
|
|
|
|
@ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"), |
|
|
|
|
@ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string") |
|
|
|
|
}) |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
@ApiOperation(value = "列表", notes = "传入account和realName") |
|
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
|
|
|
|
public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) { |
|
|
|
@ -87,7 +98,7 @@ public class UserController {
|
|
|
|
|
* 新增或修改 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/submit") |
|
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入User") |
|
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
|
|
|
|
@CacheEvict(cacheNames = {USER_CACHE}, allEntries = true) |
|
|
|
@ -99,9 +110,8 @@ public class UserController {
|
|
|
|
|
* 修改 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/update") |
|
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
|
@ApiOperation(value = "修改", notes = "传入User") |
|
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
|
|
|
|
@CacheEvict(cacheNames = {USER_CACHE}, allEntries = true) |
|
|
|
|
public R update(@Valid @RequestBody User user) { |
|
|
|
|
return R.status(userService.updateUser(user)); |
|
|
|
@ -111,7 +121,7 @@ public class UserController {
|
|
|
|
|
* 删除 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/remove") |
|
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperation(value = "删除", notes = "传入id集合") |
|
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
|
|
|
|
@CacheEvict(cacheNames = {USER_CACHE}, allEntries = true) |
|
|
|
@ -127,7 +137,7 @@ public class UserController {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/grant") |
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合") |
|
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
|
|
|
|
public R grant(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds, |
|
|
|
@ -137,7 +147,7 @@ public class UserController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/reset-password") |
|
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
@ApiOperationSupport(order = 8) |
|
|
|
|
@ApiOperation(value = "初始化密码", notes = "传入userId集合") |
|
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
|
|
|
|
public R resetPassword(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds) { |
|
|
|
@ -145,6 +155,24 @@ public class UserController {
|
|
|
|
|
return R.status(temp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改密码 |
|
|
|
|
* |
|
|
|
|
* @param oldPassword |
|
|
|
|
* @param newPassword |
|
|
|
|
* @param newPassword1 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/update-password") |
|
|
|
|
@ApiOperationSupport(order = 9) |
|
|
|
|
@ApiOperation(value = "修改密码", notes = "传入密码") |
|
|
|
|
public R updatePassword(BladeUser user, @ApiParam(value = "旧密码", required = true) @RequestParam String oldPassword, |
|
|
|
|
@ApiParam(value = "新密码", required = true) @RequestParam String newPassword, |
|
|
|
|
@ApiParam(value = "新密码", required = true) @RequestParam String newPassword1) { |
|
|
|
|
boolean temp = userService.updatePassword(user.getUserId(), oldPassword, newPassword, newPassword1); |
|
|
|
|
return R.status(temp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 用户列表 |
|
|
|
|
* |
|
|
|
@ -152,7 +180,7 @@ public class UserController {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/user-list") |
|
|
|
|
@ApiOperationSupport(order = 8) |
|
|
|
|
@ApiOperationSupport(order = 10) |
|
|
|
|
@ApiOperation(value = "用户列表", notes = "传入user") |
|
|
|
|
public R<List<User>> userList(User user) { |
|
|
|
|
List<User> list = userService.list(Condition.getQueryWrapper(user)); |
|
|
|
|