mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 06:27:21 +00:00
(improvement)(headless) opt queryTagMarketPage logic, support query without tagObjectId (#854)
This commit is contained in:
@@ -3,12 +3,9 @@ package com.tencent.supersonic.headless.api.pojo.request;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.TagDefineType;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class TagFilterPageReq extends PageSchemaItemReq {
|
||||
|
||||
@NotNull
|
||||
private Long tagObjectId;
|
||||
|
||||
private TagDefineType tagDefineType;
|
||||
|
||||
@@ -144,6 +144,12 @@ public class TagMetaServiceImpl implements TagMetaService {
|
||||
if (CollectionUtils.isEmpty(modelRespList)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
||||
if (Objects.nonNull(tagMarketPageReq.getTagObjectId())) {
|
||||
modelRespList = modelRespList.stream()
|
||||
.filter(modelResp -> tagMarketPageReq.getTagObjectId().equals(modelResp.getTagObjectId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
List<Long> modelIds = modelRespList.stream().map(model -> model.getId()).collect(Collectors.toList());
|
||||
|
||||
TagFilter tagFilter = new TagFilter();
|
||||
@@ -247,7 +253,6 @@ public class TagMetaServiceImpl implements TagMetaService {
|
||||
if (Objects.isNull(modelResp)) {
|
||||
continue;
|
||||
}
|
||||
if (tagMarketPageReq.getTagObjectId().equals(modelResp.getTagObjectId())) {
|
||||
if (CollectionUtils.isNotEmpty(tagMarketPageReq.getDomainIds())) {
|
||||
if (!tagMarketPageReq.getDomainIds().contains(modelResp.getDomainId())) {
|
||||
continue;
|
||||
@@ -259,7 +264,7 @@ public class TagMetaServiceImpl implements TagMetaService {
|
||||
}
|
||||
}
|
||||
modelRespList.add(modelResp);
|
||||
}
|
||||
|
||||
}
|
||||
return modelRespList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user