修复下属问题为空添加一个默认值

This commit is contained in:
hupeng
2024-11-10 16:06:06 +08:00
parent 166eaf3e5f
commit ab046829b2

View File

@ -41,7 +41,11 @@ public class AdminUserApiImpl implements AdminUserApi {
@Override
public List<Long> getUserListBySubordinateIds(Long id) {
List<AdminUserRespDTO> adminUserRespDTOS = getUserListBySubordinate(id);
return adminUserRespDTOS.stream().map(AdminUserRespDTO::getId).collect(Collectors.toList());
List<Long> ids = adminUserRespDTOS.stream().map(AdminUserRespDTO::getId).collect(Collectors.toList());
if(ids.isEmpty()){
ids.add(-99L);
}
return ids;
}
@Override