用户角色管理
This commit is contained in:
@ -21,6 +21,6 @@ public class AllRolesAndAssignRoleVO {
|
||||
private List<SysRole> allRole;
|
||||
|
||||
@ApiModelProperty("已分配的角色信息")
|
||||
private List<Long> roleIds;
|
||||
private List<String> roleIds;
|
||||
|
||||
}
|
||||
|
@ -30,5 +30,5 @@ public class SysUserVO extends SysUser implements Serializable {
|
||||
private BasePageRequest basePageRequest;
|
||||
|
||||
@ApiModelProperty(value = "角色ID集合")
|
||||
private List<Long> roleIds;
|
||||
private List<String> roleIds;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class SysUserRole implements Serializable {
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
private Long roleId;
|
||||
private String roleId;
|
||||
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class SysUserRoleServiceImpl extends BaseServiceImpl<SysUserRoleMapper,Sy
|
||||
public AllRolesAndAssignRoleVO getAllRolesAndAssignRole(String userId) {
|
||||
List<SysRole> list = sysRoleService.list();
|
||||
List<SysUserRole> userRoleList = list(Wrappers.<SysUserRole>lambdaQuery().eq(SysUserRole::getUserId, userId));
|
||||
List<Long> roleIds = userRoleList.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
||||
List<String> roleIds = userRoleList.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
||||
return new AllRolesAndAssignRoleVO(list, roleIds);
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ public class SysUserRoleServiceImpl extends BaseServiceImpl<SysUserRoleMapper,Sy
|
||||
|
||||
List<SysUserRole> userRoleList = new ArrayList<>();
|
||||
|
||||
for (Long roleId : sysUserVO.getRoleIds()) {
|
||||
for (String roleId : sysUserVO.getRoleIds()) {
|
||||
SysUserRole userRole = new SysUserRole();
|
||||
userRole.setRoleId(roleId);
|
||||
userRole.setUserId(sysUserVO.getUserId());
|
||||
|
Reference in New Issue
Block a user