mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
[improvement][project] supersonic 0.7.2 version backend update (#28)
Co-authored-by: jipengli <jipengli@tencent.com>
This commit is contained in:
@@ -12,11 +12,11 @@
|
||||
<artifactId>semantic-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>ru.yandex.clickhouse</groupId>-->
|
||||
<!-- <artifactId>clickhouse-jdbc</artifactId>-->
|
||||
<!-- <version>${clickhouse.jdbc.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>ru.yandex.clickhouse</groupId>-->
|
||||
<!-- <artifactId>clickhouse-jdbc</artifactId>-->
|
||||
<!-- <version>${clickhouse.jdbc.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.clickhouse</groupId>
|
||||
<artifactId>clickhouse-jdbc</artifactId>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.tencent.supersonic.semantic.api.model.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: kanedai
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.tencent.supersonic.semantic.api.model.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tencent.supersonic.semantic.api.model.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -13,7 +13,7 @@ public class QueryStat {
|
||||
|
||||
private Long id;
|
||||
private String traceId;
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
private String user;
|
||||
private String createdAt;
|
||||
/**
|
||||
@@ -79,8 +79,8 @@ public class QueryStat {
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setClassId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
public QueryStat setClassId(Long modelId) {
|
||||
this.modelId = modelId;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ public class DatasourceRelaReq {
|
||||
|
||||
private Long id;
|
||||
|
||||
@NotNull(message = "class id cat not be null")
|
||||
private Long domainId;
|
||||
@NotNull(message = "model id cat not be null")
|
||||
private Long modelId;
|
||||
|
||||
@NotNull(message = "datasource id cat not be null")
|
||||
private Long datasourceFrom;
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.tencent.supersonic.semantic.api.model.pojo.Identify;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -21,7 +20,7 @@ public class DatasourceReq extends SchemaItem {
|
||||
|
||||
private String tableQuery;
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private List<Identify> identifiers;
|
||||
|
||||
|
||||
@@ -2,17 +2,14 @@ package com.tencent.supersonic.semantic.api.model.request;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DimValueMap;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DimensionReq extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package com.tencent.supersonic.semantic.api.model.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -24,6 +21,4 @@ public class DomainReq extends SchemaItem {
|
||||
private List<String> admins = new ArrayList<>();
|
||||
|
||||
private List<String> adminOrgs = new ArrayList<>();
|
||||
|
||||
private Entity entity;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.tencent.supersonic.semantic.api.model.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.common.pojo.DataFormat;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class MetricBaseReq extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private String alias;
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ package com.tencent.supersonic.semantic.api.model.request;
|
||||
import com.tencent.supersonic.semantic.api.model.enums.MetricTypeEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.MetricTypeParams;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetricReq extends MetricBaseReq {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tencent.supersonic.semantic.api.model.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class ModelReq extends SchemaItem {
|
||||
|
||||
private Long domainId = 0L;
|
||||
|
||||
private Integer isOpen = 0;
|
||||
|
||||
private List<String> viewers = new ArrayList<>();
|
||||
|
||||
private List<String> viewOrgs = new ArrayList<>();
|
||||
|
||||
private List<String> admins = new ArrayList<>();
|
||||
|
||||
private List<String> adminOrgs = new ArrayList<>();
|
||||
|
||||
private Entity entity;
|
||||
}
|
||||
@@ -4,10 +4,10 @@ import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DomainSchemaFilterReq {
|
||||
public class ModelSchemaFilterReq {
|
||||
|
||||
/**
|
||||
* if domainIds is empty, get all domain info
|
||||
*/
|
||||
private List<Long> domainIds;
|
||||
private List<Long> modelIds;
|
||||
}
|
||||
@@ -9,4 +9,6 @@ public class PageMetricReq extends PageSchemaItemReq {
|
||||
|
||||
private String type;
|
||||
|
||||
private String key;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.tencent.supersonic.semantic.api.model.request;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.common.pojo.PageBaseReq;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PageSchemaItemReq extends PageBaseReq {
|
||||
@@ -11,7 +12,8 @@ public class PageSchemaItemReq extends PageBaseReq {
|
||||
private String name;
|
||||
private String bizName;
|
||||
private String createdBy;
|
||||
private List<Long> domainIds;
|
||||
private List<Long> domainIds = Lists.newArrayList();
|
||||
private List<Long> modelIds = Lists.newArrayList();
|
||||
private Integer sensitiveLevel;
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,11 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SqlExecuteReq {
|
||||
|
||||
public static final String LIMIT_WRAPPER = " select * from ( %s ) a limit 1000 ";
|
||||
|
||||
@NotNull(message = "domainId can not be null")
|
||||
private Long domainId;
|
||||
@NotNull(message = "modelId can not be null")
|
||||
private Long modelId;
|
||||
|
||||
@NotBlank(message = "sql can not be blank")
|
||||
private String sql;
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class DatasourceResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private Long databaseId;
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@ package com.tencent.supersonic.semantic.api.model.response;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DimValueMap;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@@ -14,7 +12,7 @@ import lombok.ToString;
|
||||
@ToString(callSuper = true)
|
||||
public class DimensionResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.tencent.supersonic.semantic.api.model.response;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
|
||||
@@ -12,17 +12,15 @@ import lombok.ToString;
|
||||
@ToString(callSuper = true)
|
||||
public class MetricResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private String domainName;
|
||||
private String modelName;
|
||||
|
||||
//ATOMIC DERIVED
|
||||
private String type;
|
||||
|
||||
private MetricTypeParams typeParams;
|
||||
|
||||
private String fullPath;
|
||||
|
||||
private String dataFormatType;
|
||||
|
||||
private DataFormat dataFormat;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.tencent.supersonic.semantic.api.model.response;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class ModelResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private List<String> viewers;
|
||||
|
||||
private List<String> viewOrgs;
|
||||
|
||||
private List<String> admins;
|
||||
|
||||
private List<String> adminOrgs;
|
||||
|
||||
private Integer isOpen = 0;
|
||||
|
||||
private Integer dimensionCnt;
|
||||
|
||||
private Integer metricCnt;
|
||||
|
||||
private Entity entity;
|
||||
|
||||
private String fullPath;
|
||||
|
||||
public boolean openToAll() {
|
||||
return isOpen != null && isOpen == 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DomainSchemaRelaResp {
|
||||
public class ModelSchemaRelaResp {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.tencent.supersonic.semantic.api.model.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -9,7 +8,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DomainSchemaResp extends DomainResp {
|
||||
public class ModelSchemaResp extends ModelResp {
|
||||
|
||||
private List<MetricSchemaResp> metrics;
|
||||
private List<DimSchemaResp> dimensions;
|
||||
@@ -6,7 +6,6 @@ import com.tencent.supersonic.common.pojo.QueryColumn;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.QueryResult;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.query.enums.FilterOperatorEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.query.enums.FilterOperatorEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -10,12 +10,12 @@ import lombok.ToString;
|
||||
public class ItemUseReq {
|
||||
|
||||
private String startTime;
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
private Boolean cacheEnable = true;
|
||||
private String metric;
|
||||
|
||||
public ItemUseReq(String startTime, Long domainId) {
|
||||
public ItemUseReq(String startTime, Long modelId) {
|
||||
this.startTime = startTime;
|
||||
this.domainId = domainId;
|
||||
this.modelId = modelId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.ToString;
|
||||
@ToString
|
||||
public class QueryDslReq {
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private String sql;
|
||||
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
package com.tencent.supersonic.semantic.api.query.request;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Cache;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Filter;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Param;
|
||||
import com.tencent.supersonic.common.pojo.Aggregator;
|
||||
import com.tencent.supersonic.common.pojo.DateConf;
|
||||
import com.tencent.supersonic.common.pojo.Order;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Cache;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Filter;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Param;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
@@ -21,7 +19,7 @@ import org.springframework.util.CollectionUtils;
|
||||
@Data
|
||||
public class QueryStructReq {
|
||||
|
||||
private Long domainId;
|
||||
private Long modelId;
|
||||
|
||||
private List<String> groups = new ArrayList<>();
|
||||
private List<Aggregator> aggregators = new ArrayList<>();
|
||||
@@ -70,8 +68,8 @@ public class QueryStructReq {
|
||||
|
||||
public String toCustomizedString() {
|
||||
StringBuilder stringBuilder = new StringBuilder("{");
|
||||
stringBuilder.append("\"domainId\":")
|
||||
.append(domainId);
|
||||
stringBuilder.append("\"modelId\":")
|
||||
.append(modelId);
|
||||
stringBuilder.append(",\"groups\":")
|
||||
.append(groups);
|
||||
stringBuilder.append(",\"aggregators\":")
|
||||
@@ -104,8 +102,8 @@ public class QueryStructReq {
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"domainId\":")
|
||||
.append(domainId);
|
||||
sb.append("\"modelId\":")
|
||||
.append(modelId);
|
||||
sb.append(",\"groups\":")
|
||||
.append(groups);
|
||||
sb.append(",\"aggregators\":")
|
||||
|
||||
Reference in New Issue
Block a user