Skip to content

Commit 377393d

Browse files
committedDec 22, 2024
Java:MultiDataSource 暂时注释 IoTDB 的依赖和配置,避免不需要的用户可能碰到 Maven 下载和编译问题
1 parent edb37d7 commit 377393d

File tree

3 files changed

+34
-38
lines changed

3 files changed

+34
-38
lines changed
 

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/pom.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@
7676
<artifactId>apijson-router</artifactId>
7777
<version>2.0.3</version>
7878
</dependency>
79-
<dependency>
80-
<groupId>org.apache.iotdb</groupId>
81-
<artifactId>iotdb-jdbc</artifactId>
82-
<version>1.3.1</version>
83-
</dependency>
84-
<dependency>
85-
<groupId>org.apache.iotdb</groupId>
86-
<artifactId>iotdb-session</artifactId>
87-
<version>1.3.1</version>
88-
</dependency>
79+
<!-- <dependency>-->
80+
<!-- <groupId>org.apache.iotdb</groupId>-->
81+
<!-- <artifactId>iotdb-jdbc</artifactId>-->
82+
<!-- <version>1.3.1</version>-->
83+
<!-- </dependency>-->
84+
<!-- <dependency>-->
85+
<!-- <groupId>org.apache.iotdb</groupId>-->
86+
<!-- <artifactId>iotdb-session</artifactId>-->
87+
<!-- <version>1.3.1</version>-->
88+
<!-- </dependency>-->
8989
<!-- <dependency>-->
9090
<!-- <groupId>com.github.APIJSON</groupId>-->
9191
<!-- <artifactId>apijson-milvus</artifactId>-->

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLConfig.java

+16-19
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import apijson.*;
2626
//import apijson.influxdb.InfluxDBUtil;
27-
import apijson.iotdb.IoTDBUtil;
27+
//import apijson.iotdb.IoTDBUtil;
2828
import apijson.orm.AbstractParser;
2929
import apijson.orm.AbstractSQLConfig;
3030
import apijson.orm.Parser;
@@ -452,20 +452,17 @@ protected int getMaxCombineCount() {
452452
return 10;
453453
}
454454

455-
456-
457-
// TODO 迁移到 apijson-influxdb 主项目 <<<<<<<<<<<<<<<<<<<<
458-
@Override
459-
public String getSchema() {
460-
return IoTDBUtil.getSchema(super.getSchema(), DEFAULT_SCHEMA, isIoTDB());
461-
}
462-
463-
@Override
464-
public String getSQLSchema() {
465-
return IoTDBUtil.getSQLSchema(super.getSQLSchema().replaceAll("-", "."), isIoTDB());
466-
}
467-
468-
// TODO 迁移到 apijson-influxdb 主项目 >>>>>>>>>>>>>>>>>>>>>>
455+
// @Override
456+
// public String getSchema() {
457+
// return InfluxDBUtil.getSchema(super.getSchema(), DEFAULT_SCHEMA, isIoTDB());
458+
//// return IoTDBUtil.getSchema(super.getSchema(), DEFAULT_SCHEMA, isIoTDB());
459+
// }
460+
//
461+
// @Override
462+
// public String getSQLSchema() {
463+
// return InfluxDBUtil.getSQLSchema(super.getSQLSchema(), isIoTDB());
464+
//// return IoTDBUtil.getSQLSchema(super.getSQLSchema().replaceAll("-", "."), isIoTDB());
465+
// }
469466

470467
@Override
471468
public String getSQLTable() {
@@ -474,10 +471,10 @@ public String getSQLTable() {
474471
// return isInfluxDB() ? t.toLowerCase() : StringUtil.firstCase(JSONRequest.recoverUnderline(t, false), false);
475472
}
476473

477-
@Override
478-
public String getTablePath() {
479-
return IoTDBUtil.getTablePath(super.getTablePath(), isIoTDB());
480-
}
474+
// @Override
475+
// public String getTablePath() {
476+
// return IoTDBUtil.getTablePath(super.getTablePath(), isIoTDB());
477+
// }
481478

482479
// 取消注释可将前端传参驼峰命名转为蛇形命名 aBCdEfg => upper ? A_B_CD_EFG : a_b_cd_efg
483480
// @Override

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java

+8-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//import apijson.influxdb.InfluxDBUtil;
2222
//import apijson.milvus.MilvusUtil;
2323
//import apijson.mongodb.MongoUtil;
24-
import apijson.iotdb.IoTDBUtil;
24+
//import apijson.iotdb.IoTDBUtil;
2525
import apijson.orm.SQLConfig;
2626
import com.alibaba.druid.pool.DruidDataSource;
2727
import com.alibaba.fastjson.JSONObject;
@@ -250,14 +250,13 @@ else if (sqlPrefix.startsWith("DELETE ")) {
250250
//
251251
// resultList = InfluxDBUtil.executeQuery(config, sql, unknownType);
252252
// }
253-
// else
254-
if (isIoTDB) {
255-
if (isWrite) {
256-
return IoTDBUtil.executeUpdate(config, sql);
257-
}
258-
259-
resultList = IoTDBUtil.executeQuery(config, sql, unknownType);
260-
}
253+
// else if (isIoTDB) {
254+
// if (isWrite) {
255+
// return IoTDBUtil.executeUpdate(config, sql);
256+
// }
257+
//
258+
// resultList = IoTDBUtil.executeQuery(config, sql, unknownType);
259+
// }
261260

262261
// TODO 把 execute 内与缓存无关只与数据库读写逻辑相关的代码抽取到 executeSQL 函数
263262
result = resultList.isEmpty() ? new JSONObject() : resultList.get(0);

0 commit comments

Comments
 (0)
Please sign in to comment.