mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 14:36:47 +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 com.tencent.supersonic.headless.api.pojo.enums.TagDefineType;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TagFilterPageReq extends PageSchemaItemReq {
|
public class TagFilterPageReq extends PageSchemaItemReq {
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private Long tagObjectId;
|
private Long tagObjectId;
|
||||||
|
|
||||||
private TagDefineType tagDefineType;
|
private TagDefineType tagDefineType;
|
||||||
|
|||||||
@@ -144,6 +144,12 @@ public class TagMetaServiceImpl implements TagMetaService {
|
|||||||
if (CollectionUtils.isEmpty(modelRespList)) {
|
if (CollectionUtils.isEmpty(modelRespList)) {
|
||||||
return new PageInfo<>();
|
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());
|
List<Long> modelIds = modelRespList.stream().map(model -> model.getId()).collect(Collectors.toList());
|
||||||
|
|
||||||
TagFilter tagFilter = new TagFilter();
|
TagFilter tagFilter = new TagFilter();
|
||||||
@@ -247,7 +253,6 @@ public class TagMetaServiceImpl implements TagMetaService {
|
|||||||
if (Objects.isNull(modelResp)) {
|
if (Objects.isNull(modelResp)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tagMarketPageReq.getTagObjectId().equals(modelResp.getTagObjectId())) {
|
|
||||||
if (CollectionUtils.isNotEmpty(tagMarketPageReq.getDomainIds())) {
|
if (CollectionUtils.isNotEmpty(tagMarketPageReq.getDomainIds())) {
|
||||||
if (!tagMarketPageReq.getDomainIds().contains(modelResp.getDomainId())) {
|
if (!tagMarketPageReq.getDomainIds().contains(modelResp.getDomainId())) {
|
||||||
continue;
|
continue;
|
||||||
@@ -259,7 +264,7 @@ public class TagMetaServiceImpl implements TagMetaService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
modelRespList.add(modelResp);
|
modelRespList.add(modelResp);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return modelRespList;
|
return modelRespList;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user