feat:针对无数据时安全处理
This commit is contained in:
parent
8c1f9d8a98
commit
752a3837f1
@ -20,10 +20,7 @@ import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
|
||||
@ -117,6 +114,10 @@ public class DepartmentService extends BaseReactiveServiceImpl<Department> {
|
||||
ids.add(qo.getAdditional());
|
||||
qo.setIds(ids);
|
||||
}
|
||||
// qo中ids为空,返回无效查询
|
||||
if (CollectionUtils.isEmpty(qo.getIds())) {
|
||||
qo.setIds(Collections.singleton("null"));
|
||||
}
|
||||
return mono;
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +93,9 @@ public class RoleService extends BaseReactiveServiceImpl<Role> {
|
||||
if (CollectionUtils.isNotEmpty(qo.getAdditions())) {
|
||||
qo.getIds().addAll(qo.getAdditions());
|
||||
}
|
||||
if (CollectionUtils.isEmpty(qo.getIds())) {
|
||||
return Flux.empty();
|
||||
}
|
||||
return super.getList(qo);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user