mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-30 22:08:36 +08:00
(improvement)(Headless)Querying dimension values and dataSet interface with tag support. (#832)
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package com.tencent.supersonic.headless.api.pojo;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.enums.QueryType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DataSetSchema {
|
||||
@@ -16,7 +14,6 @@ public class DataSetSchema {
|
||||
private Set<SchemaElement> dimensionValues = new HashSet<>();
|
||||
private SchemaElement entity = new SchemaElement();
|
||||
private QueryConfig queryConfig;
|
||||
private QueryType queryType;
|
||||
|
||||
public SchemaElement getElement(SchemaElementType elementType, long elementID) {
|
||||
Optional<SchemaElement> element = Optional.empty();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.request;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.enums.QueryType;
|
||||
import com.tencent.supersonic.headless.api.pojo.DataSetDetail;
|
||||
import com.tencent.supersonic.headless.api.pojo.QueryConfig;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
@@ -22,8 +21,6 @@ public class DataSetReq extends SchemaItem {
|
||||
|
||||
private List<String> adminOrgs;
|
||||
|
||||
private QueryType queryType;
|
||||
|
||||
public String getAdmin() {
|
||||
if (admins == null) {
|
||||
return null;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.common.pojo.enums.QueryType;
|
||||
import com.tencent.supersonic.headless.api.pojo.DataSetDetail;
|
||||
import com.tencent.supersonic.headless.api.pojo.DataSetModelConfig;
|
||||
import com.tencent.supersonic.headless.api.pojo.QueryConfig;
|
||||
@@ -30,14 +29,16 @@ public class DataSetResp extends SchemaItem {
|
||||
|
||||
private QueryConfig queryConfig;
|
||||
|
||||
private QueryType queryType;
|
||||
private List<TagItem> allMetrics = new ArrayList<>();
|
||||
|
||||
public List<Long> getAllMetrics() {
|
||||
private List<TagItem> allDimensions = new ArrayList<>();
|
||||
|
||||
public List<Long> metricIds() {
|
||||
return getDataSetModelConfigs().stream().map(DataSetModelConfig::getMetrics)
|
||||
.flatMap(Collection::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<Long> getAllDimensions() {
|
||||
public List<Long> dimensionIds() {
|
||||
return getDataSetModelConfigs().stream().map(DataSetModelConfig::getDimensions)
|
||||
.flatMap(Collection::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ public class DataSetSchemaResp extends DataSetResp {
|
||||
|
||||
private List<MetricSchemaResp> metrics = Lists.newArrayList();
|
||||
private List<DimSchemaResp> dimensions = Lists.newArrayList();
|
||||
|
||||
private List<TagResp> tags = Lists.newArrayList();
|
||||
private List<ModelResp> modelResps = Lists.newArrayList();
|
||||
|
||||
public DimSchemaResp getPrimaryKey() {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TagItem {
|
||||
|
||||
private Long itemId;
|
||||
|
||||
private int isTag;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user