mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 04:27:39 +00:00
(improvement)(headless) Compatible with historical data after removing model set (#1280)
Co-authored-by: lxwcodemonkey
This commit is contained in:
@@ -289,18 +289,17 @@ public class ModelServiceImpl implements ModelService {
|
|||||||
|
|
||||||
public List<ModelResp> getModelRespAuthInheritDomain(User user, Long domainId, AuthType authType) {
|
public List<ModelResp> getModelRespAuthInheritDomain(User user, Long domainId, AuthType authType) {
|
||||||
List<Long> domainIds = domainService.getDomainAuthSet(user, 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());
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtils.isEmpty(domainIds)) {
|
if (CollectionUtils.isEmpty(domainIds)) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
if (domainId != null) {
|
|
||||||
if (domainIds.contains(domainId)) {
|
|
||||||
domainIds = Lists.newArrayList(domainId);
|
|
||||||
} else {
|
|
||||||
return Lists.newArrayList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ModelFilter modelFilter = new ModelFilter();
|
ModelFilter modelFilter = new ModelFilter();
|
||||||
modelFilter.setIncludesDetail(false);
|
modelFilter.setIncludesDetail(false);
|
||||||
modelFilter.setDomainIds(domainIds);
|
modelFilter.setDomainIds(domainIds);
|
||||||
|
|||||||
Reference in New Issue
Block a user