mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 21:17:08 +00:00
(improvement)(semantic) support metric relate dimension setting (#229)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.tencent.supersonic.semantic.api.model.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DrillDownDimension {
|
||||
|
||||
private Long dimensionId;
|
||||
|
||||
private boolean necessary;
|
||||
|
||||
}
|
||||
@@ -34,4 +34,9 @@ public class Measure {
|
||||
this.isCreateMetric = isCreateMetric;
|
||||
this.bizName = bizName;
|
||||
}
|
||||
|
||||
public Measure(String bizName, Long datasourceId) {
|
||||
this.bizName = bizName;
|
||||
this.datasourceId = datasourceId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.model.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class RelateDimension {
|
||||
|
||||
List<DrillDownDimension> drillDownDimensions;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.tencent.supersonic.semantic.api.model.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.RelateDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.common.pojo.DataFormat;
|
||||
import lombok.Data;
|
||||
@@ -20,4 +20,6 @@ public class MetricBaseReq extends SchemaItem {
|
||||
|
||||
private List<String> tags;
|
||||
|
||||
private RelateDimension relateDimension;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.tencent.supersonic.semantic.api.model.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
@@ -27,4 +28,6 @@ public class ModelReq extends SchemaItem {
|
||||
private List<String> adminOrgs = new ArrayList<>();
|
||||
|
||||
private Entity entity;
|
||||
|
||||
private List<DrillDownDimension> drillDownDimensions;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.tencent.supersonic.semantic.api.model.response;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.common.pojo.DataFormat;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.MetricTypeParams;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.RelateDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
@@ -35,6 +36,8 @@ public class MetricResp extends SchemaItem {
|
||||
|
||||
private List<String> tags;
|
||||
|
||||
private RelateDimension relateDimension;
|
||||
|
||||
private boolean hasAdminRes = false;
|
||||
|
||||
private String defaultAgg;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.tencent.supersonic.semantic.api.model.response;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
@@ -33,6 +34,8 @@ public class ModelResp extends SchemaItem {
|
||||
|
||||
private String fullPath;
|
||||
|
||||
private List<DrillDownDimension> drillDownDimensions;
|
||||
|
||||
public boolean openToAll() {
|
||||
return isOpen != null && isOpen == 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user