|
@@ -42,14 +42,14 @@ public class UserController extends BaseController {
|
|
|
@ApiImplicitParam(name = "createStartDate", value = "开始注册时间", required = true, dataType = "String"),
|
|
|
@ApiImplicitParam(name = "createEndDate", value = "结束注册时间", required = true, dataType = "String") })
|
|
|
@GetMapping(value = "/queryPage")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('user/queryPage')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('user/queryPage')")
|
|
|
public Object queryPage(SysUserQueryInfo queryInfo) {
|
|
|
return succeed(sysUserService.queryPage(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询用户信息接口")
|
|
|
@GetMapping("/query")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('user/query')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('user/query')")
|
|
|
public Object query() {
|
|
|
AuthUser user = SecurityUtils.getUser();
|
|
|
if (user != null) {
|
|
@@ -77,8 +77,15 @@ public class UserController extends BaseController {
|
|
|
return sysUserService.get(userId);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping(value = "/updateSysUser", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public boolean updateSysUser(@RequestBody SysUser user) {
|
|
|
+ user.setUpdateTime(new Date());
|
|
|
+ sysUserService.update(user);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "新增用户")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('user/add')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('user/add')")
|
|
|
@PostMapping(value = "/add", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public Object add(@RequestBody SysUser sysUser) {
|
|
|
return succeed(sysUserService.add(sysUser));
|
|
@@ -143,7 +150,7 @@ public class UserController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "获取用户角色列表")
|
|
|
@GetMapping("/getRole")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('user/getRole')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('user/getRole')")
|
|
|
public Object getRole() {
|
|
|
AuthUser user = SecurityUtils.getUser();
|
|
|
if (user != null) {
|
|
@@ -156,7 +163,7 @@ public class UserController extends BaseController {
|
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer"),
|
|
|
@ApiImplicitParam(name = "roleIds", value = "角色id,逗号分隔", required = true, dataType = "String") })
|
|
|
@PostMapping(value = "/addRole", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
- @PreAuthorize("@pcs.hasPermissions('user/addRole')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('user/addRole')")
|
|
|
public Object getRole(String userId, String roleIds) {
|
|
|
if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(roleIds)) {
|
|
|
return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
|
|
@@ -169,7 +176,7 @@ public class UserController extends BaseController {
|
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer"),
|
|
|
@ApiImplicitParam(name = "roleIds", value = "角色id,逗号分隔", required = true, dataType = "String") })
|
|
|
@PostMapping(value = "/delRole", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
- @PreAuthorize("@pcs.hasPermissions('user/delRole')")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('user/delRole')")
|
|
|
public Object delRole(String userId, String roleIds) {
|
|
|
if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(roleIds)) {
|
|
|
return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
|