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