refactor: 用户分配角色
parent
84e8f7c27d
commit
6d4446e786
|
@ -91,7 +91,7 @@ public class SysRoleDataImpl implements ISysRoleData, IJPACommData<SysRole, Long
|
|||
@Override
|
||||
public List<SysRole> selectRolePermissionByUserId(Long userId) {
|
||||
return buildQueryTitle(PredicateBuilder.instance()
|
||||
.and(tbSysRole.delFlag.eq("0"))
|
||||
.and(tbSysRole.delFlag.eq(UserConstants.NORMAL))
|
||||
.and(tbSysUserRole.userId.eq(userId))
|
||||
.build());
|
||||
}
|
||||
|
|
|
@ -237,12 +237,12 @@ public class SysUserController extends BaseController {
|
|||
/**
|
||||
* 根据用户编号获取授权角色
|
||||
*
|
||||
* @param userId 用户ID
|
||||
*/
|
||||
@ApiOperation("根据用户编号获取授权角色")
|
||||
@SaCheckPermission("system:user:query")
|
||||
@PostMapping("/authRole/{userId}")
|
||||
public SysUserInfoVo authRole(@PathVariable Long userId) {
|
||||
@PostMapping("/authRoleByUserId")
|
||||
public SysUserInfoVo authRole(@Validated @RequestBody Request<Long> bo) {
|
||||
Long userId = bo.getData();
|
||||
SysUserVo user = userService.selectUserById(userId);
|
||||
List<SysRoleVo> roles = roleService.selectRolesByUserId(userId);
|
||||
SysUserInfoVo userInfoVo = new SysUserInfoVo();
|
||||
|
|
Loading…
Reference in New Issue