mirror of https://gitee.com/stylefeng/roses
【7.6.0】【sys】【user】更新获取用户的角色列表
parent
25523883da
commit
def6f6fa4e
|
@ -10,8 +10,10 @@ import cn.stylefeng.roses.kernel.sys.api.pojo.SimpleUserDTO;
|
|||
import cn.stylefeng.roses.kernel.sys.api.pojo.UserOrgDTO;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.entity.SysUser;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.entity.SysUserOrg;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.entity.SysUserRole;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.factory.UserOrgFactory;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.service.SysUserOrgService;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.service.SysUserRoleService;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.service.SysUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -45,6 +47,9 @@ public class UserIntegrationService implements SysUserServiceApi {
|
|||
@Resource
|
||||
private DbOperatorApi dbOperatorApi;
|
||||
|
||||
@Resource
|
||||
private SysUserRoleService sysUserRoleService;
|
||||
|
||||
@Override
|
||||
public SimpleUserDTO getUserInfoByUserId(Long userId) {
|
||||
|
||||
|
@ -145,7 +150,16 @@ public class UserIntegrationService implements SysUserServiceApi {
|
|||
|
||||
@Override
|
||||
public List<Long> getUserRoleIdList(Long userId) {
|
||||
return null;
|
||||
if (userId == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<SysUserRole> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SysUserRole::getUserId, userId);
|
||||
wrapper.select(SysUserRole::getRoleId);
|
||||
List<SysUserRole> sysUserRoleList = this.sysUserRoleService.list(wrapper);
|
||||
|
||||
return sysUserRoleList.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
|
|||
|
||||
@Override
|
||||
public void validateHaveUserBind(Set<Long> beRemovedUserIdList) {
|
||||
|
||||
// none
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue