更新了配置模块
This commit is contained in:
parent
e1d009479e
commit
2bcb606319
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>io.gisbi</groupId>
|
||||
<artifactId>extensions</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>extensions-datasource</artifactId>
|
||||
@ -37,7 +37,7 @@
|
||||
<dependency>
|
||||
<groupId>io.gisbi</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -62,4 +62,5 @@ public class DatasetTableDTO implements Serializable {
|
||||
private Long lastUpdateTime = 0L;
|
||||
private String status;
|
||||
|
||||
private Boolean isCross;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class DatasetTableFieldDTO implements Serializable {
|
||||
/**
|
||||
* de字段名用作唯一标识
|
||||
*/
|
||||
private String dataeaseName;
|
||||
private String gisbiName;
|
||||
|
||||
/**
|
||||
* 维度/指标标识 d:维度,q:指标
|
||||
@ -82,7 +82,7 @@ public class DatasetTableFieldDTO implements Serializable {
|
||||
private Integer scale;
|
||||
|
||||
/**
|
||||
* dataease字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制, 7-URL
|
||||
* gisbi字段类型:0-文本,1-时间,2-整型数值,3-浮点数值,4-布尔,5-地理位置,6-二进制, 7-URL
|
||||
*/
|
||||
private Integer deType;
|
||||
|
||||
|
@ -23,10 +23,6 @@ public class DatasourceDTO implements Serializable {
|
||||
* 数据源名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
|
@ -27,6 +27,7 @@ public class DatasourceRequest implements Serializable {
|
||||
private Map<Long, DatasourceSchemaDTO> dsList;
|
||||
private List<TableFieldWithValue> tableFieldWithValues;
|
||||
private String token;
|
||||
private Boolean isCross;
|
||||
|
||||
public DatasourceRequest() {
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
package io.gisbi.extensions.datasource.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ExecuteResult {
|
||||
|
||||
private int count;
|
||||
|
||||
private List<String> generatedKeys;
|
||||
}
|
@ -23,9 +23,11 @@ public class TableField implements Serializable {
|
||||
private int extField;
|
||||
private String jsonPath;
|
||||
private boolean primary;
|
||||
private boolean autoIncrement;
|
||||
List<Object> value;
|
||||
|
||||
private int inCount;
|
||||
private String term = "eq";
|
||||
private Integer typeNumber;
|
||||
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ package io.gisbi.extensions.datasource.dto;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Slf4j
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@ -18,6 +20,8 @@ public class TableFieldWithValue implements Serializable {
|
||||
private String filedName;
|
||||
private String typeName;
|
||||
private Integer type;
|
||||
private String columnTypeName;
|
||||
private boolean autoIncrement;
|
||||
|
||||
private String isDateTime;
|
||||
private String dateFormat;
|
||||
@ -27,8 +31,14 @@ public class TableFieldWithValue implements Serializable {
|
||||
public static TableFieldWithValue copy(TableFieldWithValue tableFieldWithValue) {
|
||||
return new TableFieldWithValue()
|
||||
.setValue(tableFieldWithValue.getValue())
|
||||
.setAutoIncrement(tableFieldWithValue.isAutoIncrement())
|
||||
.setFiledName(tableFieldWithValue.getFiledName())
|
||||
.setTypeName(tableFieldWithValue.getTypeName())
|
||||
.setType(tableFieldWithValue.getType());
|
||||
.setType(tableFieldWithValue.getType())
|
||||
.setColumnTypeName(tableFieldWithValue.getColumnTypeName())
|
||||
.setIsDateTime(tableFieldWithValue.getIsDateTime())
|
||||
.setDateFormat(tableFieldWithValue.getDateFormat())
|
||||
.setTerm(tableFieldWithValue.getTerm())
|
||||
.setDeExtractType(tableFieldWithValue.getDeExtractType());
|
||||
}
|
||||
}
|
||||
|
@ -2,14 +2,10 @@ package io.gisbi.extensions.datasource.plugin;
|
||||
|
||||
import io.gisbi.exception.DEException;
|
||||
import io.gisbi.extensions.datasource.dto.DatasourceRequest;
|
||||
import io.gisbi.extensions.datasource.factory.ProviderFactory;
|
||||
import io.gisbi.extensions.datasource.provider.Provider;
|
||||
import io.gisbi.extensions.datasource.vo.XpackPluginsDatasourceVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.ProtectionDomain;
|
||||
@ -23,7 +19,7 @@ import java.util.jar.JarFile;
|
||||
* @Author Junjun
|
||||
*/
|
||||
public abstract class DataEaseDatasourcePlugin extends Provider {
|
||||
private final String DEFAULT_FILE_PATH = "/opt/gisbi1.0/drivers/plugin";
|
||||
private final String DEFAULT_FILE_PATH = "/opt/gisbi2.0/drivers/plugin";
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -97,8 +97,8 @@ public abstract class Provider {
|
||||
|
||||
}
|
||||
|
||||
public int executeUpdate(DatasourceRequest datasourceRequest) {
|
||||
return 0;
|
||||
public ExecuteResult executeUpdate(DatasourceRequest datasourceRequest, String autoIncrementPkName) {
|
||||
return new ExecuteResult();
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ public class Configuration {
|
||||
private String keywordSuffix = "";
|
||||
private String aliasPrefix = "";
|
||||
private String aliasSuffix = "";
|
||||
private String jdbc;
|
||||
protected String jdbc;
|
||||
private String host;
|
||||
private String jdbcUrl;
|
||||
private String urlType;
|
||||
@ -31,7 +31,7 @@ public class Configuration {
|
||||
private int initialPoolSize = 5;
|
||||
private int minPoolSize = 5;
|
||||
private int maxPoolSize = 20;
|
||||
private int queryTimeout = 10;
|
||||
private int queryTimeout = 30;
|
||||
private boolean useSSH = false;
|
||||
private String sshHost;
|
||||
private Integer sshPort;
|
||||
|
@ -11,38 +11,40 @@ public class DatasourceConfiguration extends Configuration {
|
||||
|
||||
|
||||
static public enum DatasourceType {
|
||||
folder("folder", "folder", "folder", null, null),
|
||||
API("API", "API", "API", "`", "`"),
|
||||
Excel("Excel", "Excel", "LOCALFILE", "`", "`"),
|
||||
mysql("mysql", "Mysql", "OLTP", "`", "`"),
|
||||
impala("impala", "Apache Impala", "OLAP", "`", "`"),
|
||||
mariadb("mariadb", "Mariadb", "OLTP", "`", "`"),
|
||||
StarRocks("StarRocks", "StarRocks", "OLAP", "`", "`"),
|
||||
es("es", "Elasticsearch", "OLAP", "\"", "\""),
|
||||
doris("doris", "Apache Doris", "OLAP", "`", "`"),
|
||||
TiDB("TiDB", "TiDB", "OLTP", "`", "`"),
|
||||
oracle("oracle", "ORACLE", "OLTP", "\"", "\""),
|
||||
pg("pg", "PostgreSQL", "OLTP", "\"", "\""),
|
||||
redshift("redshift", "AWS Redshift", "OLTP", "\"", "\""),
|
||||
db2("db2", "Db2", "OLTP", "", ""),
|
||||
ck("ck", "Clickhouse", "OLAP", "`", "`"),
|
||||
h2("h2", "H2", "OLAP", "\"", "\""),
|
||||
sqlServer("sqlServer", "Sqlserver", "DL", "[", "]"),
|
||||
mongo("mongo", "MongoDB", "DL", "`", "`");
|
||||
folder("folder", "folder", "folder", null, null, 25),
|
||||
API("API", "API", "API", "`", "`", 15),
|
||||
Excel("Excel", "Excel", "LOCALFILE", "`", "`", 16),
|
||||
ExcelRemote("ExcelRemote", "ExcelRemote", "LOCALFILE", "`", "`", 29),
|
||||
mysql("mysql", "Mysql", "OLTP", "`", "`", 27),
|
||||
impala("impala", "Apache Impala", "OLAP", "`", "`", 5),
|
||||
mariadb("mariadb", "Mariadb", "OLTP", "`", "`", 6),
|
||||
StarRocks("StarRocks", "StarRocks", "OLAP", "`", "`", 7),
|
||||
es("es", "Elasticsearch", "OLAP", "\"", "\"", 14),
|
||||
doris("doris", "Apache Doris", "OLAP", "`", "`", 26),
|
||||
TiDB("TiDB", "TiDB", "OLTP", "`", "`", 3),
|
||||
oracle("oracle", "ORACLE", "OLTP", "\"", "\"", 1),
|
||||
pg("pg", "PostgreSQL", "OLTP", "\"", "\"", 9),
|
||||
redshift("redshift", "AWS Redshift", "OLTP", "\"", "\"", 13),
|
||||
db2("db2", "Db2", "OLTP", "", "", 12),
|
||||
ck("ck", "Clickhouse", "OLAP", "`", "`", 11),
|
||||
h2("h2", "H2", "OLAP", "\"", "\"", 30),
|
||||
sqlServer("sqlServer", "Sqlserver", "DL", "[", "]", 2),
|
||||
mongo("mongo", "MongoDB", "DL", "`", "`", 10);
|
||||
|
||||
private String type;
|
||||
private String name;
|
||||
|
||||
private Integer flag;
|
||||
private String catalog;
|
||||
private String prefix;
|
||||
private String suffix;
|
||||
|
||||
DatasourceType(String type, String name, String catalog, String prefix, String suffix) {
|
||||
DatasourceType(String type, String name, String catalog, String prefix, String suffix, Integer flag) {
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
this.catalog = catalog;
|
||||
this.prefix = prefix;
|
||||
this.suffix = suffix;
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
@ -64,5 +66,9 @@ public class DatasourceConfiguration extends Configuration {
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
public Integer getFlag() {
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user