(improvement)(headless) Compatible with historical data after removing model set (#1280)

Co-authored-by: lxwcodemonkey
This commit is contained in:
LXW
2024-06-29 15:09:07 +08:00
committed by GitHub
parent ee86924205
commit e080306b67

View File

@@ -289,18 +289,17 @@ public class ModelServiceImpl implements ModelService {
public List<ModelResp> getModelRespAuthInheritDomain(User user, Long domainId, AuthType authType) {
List<Long> domainIds = domainService.getDomainAuthSet(user, authType)
.stream().map(DomainResp::getId)
.stream().filter(domainResp -> {
if (domainId == null) {
return true;
} else {
return domainId.equals(domainResp.getId()) || domainId.equals(domainResp.getParentId());
}
}).map(DomainResp::getId)
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(domainIds)) {
return Lists.newArrayList();
}
if (domainId != null) {
if (domainIds.contains(domainId)) {
domainIds = Lists.newArrayList(domainId);
} else {
return Lists.newArrayList();
}
}
ModelFilter modelFilter = new ModelFilter();
modelFilter.setIncludesDetail(false);
modelFilter.setDomainIds(domainIds);