mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 22:25:19 +00:00
[improvement][headless]Refactor translator module to make code logic cleaner and more readable.
This commit is contained in:
@@ -18,6 +18,8 @@ public class ModelDetail {
|
||||
|
||||
private String queryType;
|
||||
|
||||
private String dbType;
|
||||
|
||||
private String sqlQuery;
|
||||
|
||||
private String tableQuery;
|
||||
|
||||
@@ -4,8 +4,7 @@ import com.google.common.base.Objects;
|
||||
import com.tencent.supersonic.common.pojo.RecordInfo;
|
||||
import com.tencent.supersonic.common.pojo.enums.SensitiveLevelEnum;
|
||||
import com.tencent.supersonic.common.pojo.enums.TypeEnums;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -17,19 +16,20 @@ import java.util.List;
|
||||
public class SchemaItem extends RecordInfo {
|
||||
|
||||
private static String aliasSplit = ",";
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
protected Long id;
|
||||
|
||||
private String bizName;
|
||||
protected String name;
|
||||
|
||||
private String description;
|
||||
protected String bizName;
|
||||
|
||||
private Integer status;
|
||||
protected String description;
|
||||
|
||||
private TypeEnums typeEnum;
|
||||
protected Integer status;
|
||||
|
||||
private Integer sensitiveLevel = SensitiveLevelEnum.LOW.getCode();
|
||||
protected TypeEnums typeEnum;
|
||||
|
||||
protected Integer sensitiveLevel = SensitiveLevelEnum.LOW.getCode();
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.common.pojo.RecordInfo;
|
||||
import com.tencent.supersonic.common.util.AESEncryptionUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -64,4 +65,8 @@ public class DatabaseResp extends RecordInfo {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String passwordDecrypt() {
|
||||
return AESEncryptionUtil.aesDecryptECB(password);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.headless.api.pojo.Dimension;
|
||||
import com.tencent.supersonic.headless.api.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.headless.api.pojo.Field;
|
||||
import com.tencent.supersonic.headless.api.pojo.Identify;
|
||||
import com.tencent.supersonic.headless.api.pojo.ModelDetail;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.*;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.IdentifyType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.*;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,6 +18,7 @@ import java.util.stream.Collectors;
|
||||
@ToString(callSuper = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ModelResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
@@ -62,6 +55,14 @@ public class ModelResp extends SchemaItem {
|
||||
return isOpen != null && isOpen == 1;
|
||||
}
|
||||
|
||||
public List<Measure> getMeasures() {
|
||||
return modelDetail.getMeasures();
|
||||
}
|
||||
|
||||
public List<Identify> getIdentifiers() {
|
||||
return modelDetail.getIdentifiers();
|
||||
}
|
||||
|
||||
public List<Dimension> getTimeDimension() {
|
||||
if (modelDetail == null) {
|
||||
return Lists.newArrayList();
|
||||
|
||||
Reference in New Issue
Block a user