|
@@ -28,7 +28,7 @@ public class UserController {
|
|
|
*/
|
|
|
@PostMapping("/frontUserLogin")
|
|
|
public Result frontUserLogin(@RequestBody User user) {
|
|
|
- if (Blank.isEmpty(user) ||Blank.isEmpty(user.getUserName()) || Blank.isEmpty(user.getPassword())) {
|
|
|
+ if (Blank.isEmpty(user, user.getUserName(), user.getPassword())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.frontUserLogin(user.getUserName(), user.getPassword());
|
|
@@ -41,8 +41,8 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/backUserLogin")
|
|
|
- public Result backUserLogin(@RequestBody User user ) {
|
|
|
- if (Blank.isEmpty(user) ||Blank.isEmpty(user.getUserName()) || Blank.isEmpty(user.getPassword())) {
|
|
|
+ public Result backUserLogin(@RequestBody User user) {
|
|
|
+ if (Blank.isEmpty(user, user.getUserName(), user.getPassword())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.backUserLogin(user.getUserName(), user.getPassword());
|
|
@@ -68,7 +68,7 @@ public class UserController {
|
|
|
@PostMapping("/addUser")
|
|
|
@PermissionControl
|
|
|
public Result addUser(String userName, String password) {
|
|
|
- if (Blank.isEmpty(userName) || Blank.isEmpty(password)) {
|
|
|
+ if (Blank.isEmpty(userName, password)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.addUser(userName, password);
|
|
@@ -99,7 +99,7 @@ public class UserController {
|
|
|
@GetMapping("/getUserPage")
|
|
|
@PermissionControl
|
|
|
public Result getUserPage(int page, int limit) {
|
|
|
- if (Blank.isEmpty(page) || Blank.isEmpty(limit) || page < 1 || limit < 1) {
|
|
|
+ if (Blank.isEmpty(page, limit) || page < 1 || limit < 1) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.getUserPage(page, limit);
|
|
@@ -128,7 +128,7 @@ public class UserController {
|
|
|
@PostMapping("/updateUserStateById")
|
|
|
@PermissionControl
|
|
|
public Result updateUserStateById(String userId, Integer userState) {
|
|
|
- if (Blank.isEmpty(userId) || Blank.isEmpty(userState)) {
|
|
|
+ if (Blank.isEmpty(userId, userState)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.updateUserStateById(userId, userState);
|
|
@@ -173,7 +173,7 @@ public class UserController {
|
|
|
@PostMapping("/assignRole")
|
|
|
@PermissionControl
|
|
|
public Result assignRole(@RequestBody User user) {
|
|
|
- if (Blank.isEmpty(user) || Blank.isEmpty(user.getUserId()) || Blank.isEmpty(user.getRoleList())) {
|
|
|
+ if (Blank.isEmpty(user, user.getUserId(), user.getRoleList())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.assignRole(user.getUserId(), user.getRoleList());
|
|
@@ -189,7 +189,7 @@ public class UserController {
|
|
|
@GetMapping("/getRoleListByPage")
|
|
|
@PermissionControl
|
|
|
public Result getRoleListByPage(Integer page, Integer limit) {
|
|
|
- if (Blank.isEmpty(page) || Blank.isEmpty(limit) || page < 1 || limit < 1) {
|
|
|
+ if (Blank.isEmpty(page, limit) || page < 1 || limit < 1) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.getRoleListByPage(page, limit);
|
|
@@ -265,7 +265,7 @@ public class UserController {
|
|
|
@GetMapping("/getPermissionListByPage")
|
|
|
@PermissionControl
|
|
|
public Result getPermissionListByPage(Integer page, Integer limit) {
|
|
|
- if (Blank.isEmpty(page) || Blank.isEmpty(limit) || page < 1 || limit < 1) {
|
|
|
+ if (Blank.isEmpty(page, limit) || page < 1 || limit < 1) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.getPermissionListByPage(page, limit);
|
|
@@ -295,7 +295,7 @@ public class UserController {
|
|
|
@PostMapping("/assignPermission")
|
|
|
@PermissionControl
|
|
|
public Result assignPermission(@RequestBody Role role) {
|
|
|
- if (Blank.isEmpty(role) || Blank.isEmpty(role.getId()) || Blank.isEmpty(role.getPermissionList())) {
|
|
|
+ if (Blank.isEmpty(role, role.getId(), role.getPermissionList())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return userService.assignPermission(role.getId(), role.getPermissionList());
|