mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(improvement)(Headless) fix tag list filter by status (#869)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -27,7 +27,7 @@ public class MetaFilter {
|
||||
|
||||
private Integer sensitiveLevel;
|
||||
|
||||
private List<Integer> status;
|
||||
private Integer status;
|
||||
|
||||
private String key;
|
||||
|
||||
|
||||
@@ -109,8 +109,8 @@ public class DataSetServiceImpl
|
||||
if (!CollectionUtils.isEmpty(metaFilter.getIds())) {
|
||||
wrapper.lambda().in(DataSetDO::getId, metaFilter.getIds());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(metaFilter.getStatus())) {
|
||||
wrapper.lambda().in(DataSetDO::getStatus, metaFilter.getStatus());
|
||||
if (metaFilter.getStatus() != null) {
|
||||
wrapper.lambda().eq(DataSetDO::getStatus, metaFilter.getStatus());
|
||||
}
|
||||
wrapper.lambda().ne(DataSetDO::getStatus, StatusEnum.DELETED.getCode());
|
||||
return list(wrapper).stream().map(entry -> convert(entry, user)).collect(Collectors.toList());
|
||||
@@ -212,7 +212,7 @@ public class DataSetServiceImpl
|
||||
@Override
|
||||
public Map<Long, List<Long>> getModelIdToDataSetIds(List<Long> dataSetIds, User user) {
|
||||
MetaFilter metaFilter = new MetaFilter();
|
||||
metaFilter.setStatus(Lists.newArrayList(StatusEnum.ONLINE.getCode()));
|
||||
metaFilter.setStatus(StatusEnum.ONLINE.getCode());
|
||||
metaFilter.setIds(dataSetIds);
|
||||
List<DataSetResp> dataSetList = dataSetSchemaCache.getIfPresent(metaFilter);
|
||||
if (CollectionUtils.isEmpty(dataSetList)) {
|
||||
|
||||
@@ -160,7 +160,7 @@ public class SchemaServiceImpl implements SchemaService {
|
||||
|
||||
public List<DataSetSchemaResp> buildDataSetSchema(DataSetFilterReq filter) {
|
||||
MetaFilter metaFilter = new MetaFilter();
|
||||
metaFilter.setStatus(Lists.newArrayList(StatusEnum.ONLINE.getCode()));
|
||||
metaFilter.setStatus(StatusEnum.ONLINE.getCode());
|
||||
metaFilter.setIds(filter.getDataSetIds());
|
||||
List<DataSetResp> dataSetResps = dataSetService.getDataSetList(metaFilter, User.getFakeUser());
|
||||
Map<Long, DataSetResp> dataSetRespMap = getDataSetMap(dataSetResps);
|
||||
@@ -210,7 +210,7 @@ public class SchemaServiceImpl implements SchemaService {
|
||||
return modelSchemaResps;
|
||||
}
|
||||
MetaFilter metaFilter = new MetaFilter(modelIds);
|
||||
metaFilter.setStatus(Lists.newArrayList(StatusEnum.ONLINE.getCode()));
|
||||
metaFilter.setStatus(StatusEnum.ONLINE.getCode());
|
||||
Map<Long, List<MetricResp>> metricRespMap = metricService.getMetrics(metaFilter)
|
||||
.stream().collect(Collectors.groupingBy(MetricResp::getModelId));
|
||||
Map<Long, List<DimensionResp>> dimensionRespsMap = dimensionService.getDimensions(metaFilter)
|
||||
|
||||
@@ -143,12 +143,8 @@
|
||||
<if test="sensitiveLevel != null">
|
||||
and t.sensitive_level = #{sensitiveLevel}
|
||||
</if>
|
||||
<if test="status != null and status.size >0">
|
||||
and t.status in
|
||||
<foreach collection="status" index="index" item="status" open="(" close=")"
|
||||
separator=",">
|
||||
#{status}
|
||||
</foreach>
|
||||
<if test="status != null">
|
||||
and t.status = #{status}
|
||||
</if>
|
||||
<if test="modelIds != null and modelIds.size >0">
|
||||
and t.model_id in
|
||||
|
||||
@@ -150,12 +150,8 @@
|
||||
<if test="sensitiveLevel != null">
|
||||
and t.sensitive_level = #{sensitiveLevel}
|
||||
</if>
|
||||
<if test="status != null and status.size >0">
|
||||
and t.status in
|
||||
<foreach collection="status" index="index" item="status" open="(" close=")"
|
||||
separator=",">
|
||||
#{status}
|
||||
</foreach>
|
||||
<if test="status != null">
|
||||
and t.status = #{status}
|
||||
</if>
|
||||
<if test="modelIds != null and modelIds.size >0">
|
||||
and t.model_id in
|
||||
|
||||
Reference in New Issue
Block a user