Skip to content

Commit 17dd9b6

Browse files
committed
Java:MultiDataSource 升级 APIJSON 6.1.0, apijson-framework 6.1.0, apijson-router 1.6.0, apijson-column 1.6.0, UnitAuto 2.9.0, MySQL JDBC 8.0.33, PostgreSQL JDBC 42.3.8;更新 APIAuto
1 parent 604625a commit 17dd9b6

19 files changed

+468
-264
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>apijson.boot</groupId>
77
<artifactId>apijson-boot-multi-datasource</artifactId>
8-
<version>6.0.0</version>
8+
<version>6.1.0</version>
99
<packaging>jar</packaging>
1010

1111
<name>APIJSONBoot-MultiDataSource</name>
@@ -37,12 +37,12 @@
3737
<dependency>
3838
<groupId>com.github.TommyLemon</groupId>
3939
<artifactId>unitauto-java</artifactId>
40-
<version>2.7.2</version>
40+
<version>2.9.0</version>
4141
</dependency>
4242
<dependency>
4343
<groupId>com.github.TommyLemon</groupId>
4444
<artifactId>unitauto-jar</artifactId>
45-
<version>2.7.2</version>
45+
<version>2.9.0</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>io.github.classgraph</groupId>
@@ -56,35 +56,35 @@
5656
<dependency>
5757
<groupId>com.github.Tencent</groupId>
5858
<artifactId>APIJSON</artifactId>
59-
<version>6.0.0</version>
59+
<version>6.1.0</version>
6060
</dependency>
6161
<dependency>
6262
<groupId>com.github.APIJSON</groupId>
6363
<artifactId>apijson-framework</artifactId>
64-
<version>6.0.0</version>
64+
<version>6.1.0</version>
6565
</dependency>
6666
<dependency>
6767
<groupId>com.github.APIJSON</groupId>
6868
<artifactId>apijson-column</artifactId>
69-
<version>1.5.0</version>
69+
<version>1.6.0</version>
7070
</dependency>
7171
<dependency>
7272
<groupId>com.github.APIJSON</groupId>
7373
<artifactId>apijson-router</artifactId>
74-
<version>1.5.0</version>
74+
<version>1.6.0</version>
7575
</dependency>
7676
<!-- 可使用 libs 目录的 apijson-orm.jar, apijson-framework.jar, apijson-column.jar 来替代,两种方式二选一 >>>>>>>>>> -->
7777

7878
<!-- 需要用的数据库 JDBC 驱动 -->
7979
<dependency>
8080
<groupId>mysql</groupId>
8181
<artifactId>mysql-connector-java</artifactId>
82-
<version>8.0.29</version>
82+
<version>8.0.33</version>
8383
</dependency>
8484
<dependency>
8585
<groupId>org.postgresql</groupId>
8686
<artifactId>postgresql</artifactId>
87-
<version>42.3.4</version>
87+
<version>42.3.8</version>
8888
</dependency>
8989
<dependency>
9090
<groupId>net.sourceforge.jtds</groupId>
@@ -106,11 +106,11 @@
106106
<artifactId>taos-jdbcdriver</artifactId>
107107
<version>2.0.38</version>
108108
</dependency>
109-
<dependency>
110-
<groupId>org.nebula-contrib</groupId>
111-
<artifactId>nebula-jdbc</artifactId>
112-
<version>3.0.0</version>
113-
</dependency>
109+
<!-- <dependency>-->
110+
<!-- <groupId>org.nebula-contrib</groupId>-->
111+
<!-- <artifactId>nebula-jdbc</artifactId>-->
112+
<!-- <version>3.0.0</version>-->
113+
<!-- </dependency>-->
114114
<dependency>
115115
<groupId>org.influxdb</groupId>
116116
<artifactId>influxdb-java</artifactId>

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java

Lines changed: 127 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@
1919
import com.alibaba.fastjson.serializer.SerializerFeature;
2020
import com.alibaba.fastjson.serializer.ValueFilter;
2121
import com.fasterxml.jackson.databind.util.LRUMap;
22-
import com.vesoft.nebula.Date;
23-
import com.vesoft.nebula.DateTime;
24-
import com.vesoft.nebula.Duration;
25-
import com.vesoft.nebula.Edge;
26-
import com.vesoft.nebula.NullType;
27-
import com.vesoft.nebula.Tag;
28-
import com.vesoft.nebula.Time;
29-
import com.vesoft.nebula.Value;
30-
import com.vesoft.nebula.Vertex;
31-
import com.vesoft.nebula.client.graph.data.DateTimeWrapper;
32-
import com.vesoft.nebula.client.graph.data.DateWrapper;
33-
import com.vesoft.nebula.client.graph.data.DurationWrapper;
34-
import com.vesoft.nebula.client.graph.data.TimeWrapper;
35-
import com.vesoft.nebula.client.graph.data.ValueWrapper;
22+
//import com.vesoft.nebula.Date;
23+
//import com.vesoft.nebula.DateTime;
24+
//import com.vesoft.nebula.Duration;
25+
//import com.vesoft.nebula.Edge;
26+
//import com.vesoft.nebula.NullType;
27+
//import com.vesoft.nebula.Tag;
28+
//import com.vesoft.nebula.Time;
29+
//import com.vesoft.nebula.Value;
30+
//import com.vesoft.nebula.Vertex;
31+
//import com.vesoft.nebula.client.graph.data.DateTimeWrapper;
32+
//import com.vesoft.nebula.client.graph.data.DateWrapper;
33+
//import com.vesoft.nebula.client.graph.data.DurationWrapper;
34+
//import com.vesoft.nebula.client.graph.data.TimeWrapper;
35+
//import com.vesoft.nebula.client.graph.data.ValueWrapper;
3636

3737
import org.springframework.beans.factory.annotation.Autowired;
3838
import org.springframework.http.*;
@@ -1865,7 +1865,7 @@ public String execute(@RequestBody String request, HttpSession session) {
18651865
prefix = prefix.substring(mid + 1);
18661866
}
18671867

1868-
if (DemoSQLConfig.DATABASE_INFLUXDB.equalsIgnoreCase(prefix) || DemoSQLExecutor.DATABASE_CASSANDRA.equalsIgnoreCase(prefix)) {
1868+
if (DemoSQLConfig.DATABASE_INFLUXDB.equalsIgnoreCase(prefix) || DemoSQLConfig.DATABASE_CASSANDRA.equalsIgnoreCase(prefix)) {
18691869
database = prefix.toUpperCase();
18701870

18711871
int end = uri.lastIndexOf("/");
@@ -1882,7 +1882,7 @@ public String execute(@RequestBody String request, HttpSession session) {
18821882
// password = "apijson@123";
18831883
// }
18841884

1885-
if (DemoSQLExecutor.DATABASE_CASSANDRA.equalsIgnoreCase(prefix)) { // unknown protocol: jdbc
1885+
if (DemoSQLConfig.DATABASE_CASSANDRA.equalsIgnoreCase(prefix)) { // unknown protocol: jdbc
18861886
account = "test"; // "peter";
18871887
password = "test"; // null;
18881888
}
@@ -1919,7 +1919,7 @@ public String execute(@RequestBody String request, HttpSession session) {
19191919
long rsDuration = 0;
19201920
long executeStartTime = System.currentTimeMillis();
19211921

1922-
if (DemoSQLConfig.DATABASE_INFLUXDB.equals(database) || DemoSQLExecutor.DATABASE_CASSANDRA.equals(database)) {
1922+
if (DemoSQLConfig.DATABASE_INFLUXDB.equals(database) || DemoSQLConfig.DATABASE_CASSANDRA.equals(database)) {
19231923
JSONObject result = executor.execute(config, false);
19241924
executeDuration = System.currentTimeMillis() - executeStartTime;
19251925

@@ -2017,116 +2017,116 @@ public String execute(@RequestBody String request, HttpSession session) {
20172017
return com.alibaba.fastjson.JSON.toJSONString(result, new ValueFilter() {
20182018
@Override
20192019
public Object process(Object o, String key, Object val) {
2020-
if (val instanceof ValueWrapper) {
2021-
return process(o, key, ((ValueWrapper) val).getValue());
2022-
}
2023-
2024-
if (val instanceof Value) {
2025-
return process(o, key, ((Value) val).getFieldValue());
2026-
}
2027-
2028-
if (val instanceof Vertex) {
2029-
JSONObject obj = new JSONObject(true);
2030-
obj.put("vid", new String(((Vertex) val).getVid().getSVal()));
2031-
obj.put("str", val.toString());
2032-
2033-
List<Tag> tags = ((Vertex) val).getTags();
2034-
2035-
if (tags != null) {
2036-
JSONArray arr = new JSONArray();
2037-
for (int i = 0; i < tags.size(); i++) {
2038-
arr.add(process(o, String.valueOf(i), tags.get(i)));
2039-
}
2040-
obj.put("tags", arr);
2041-
}
2042-
2043-
return obj;
2044-
}
2045-
2046-
if (val instanceof Tag) {
2047-
JSONObject obj = new JSONObject(true);
2048-
obj.put("name", new String(((Tag) val).getName()));
2049-
obj.put("str", val.toString());
2050-
2051-
Map<byte[], Value> props = ((Tag) val).getProps();
2052-
2053-
if (props != null) {
2054-
JSONObject propsObj = new JSONObject(true);
2055-
props.forEach(new BiConsumer<byte[], Value>() {
2056-
@Override
2057-
public void accept(byte[] bytes, Value value) {
2058-
String k = new String(bytes);
2059-
propsObj.put(k, process(propsObj, k, value));
2060-
}
2061-
});
2062-
obj.put("props", propsObj);
2063-
}
2064-
2065-
return obj;
2066-
}
2067-
2068-
if (val instanceof Edge) {
2069-
JSONObject obj = new JSONObject(true);
2070-
obj.put("name", new String(((Edge) val).getName()));
2071-
obj.put("str", val.toString());
2072-
2073-
Map<byte[], Value> props = ((Edge) val).getProps();
2074-
2075-
if (props != null) {
2076-
JSONObject propsObj = new JSONObject(true);
2077-
props.forEach(new BiConsumer<byte[], Value>() {
2078-
@Override
2079-
public void accept(byte[] bytes, Value value) {
2080-
String k = new String(bytes);
2081-
propsObj.put(k, process(propsObj, k, value));
2082-
}
2083-
});
2084-
obj.put("props", propsObj);
2085-
}
2086-
2087-
return obj;
2088-
}
2089-
2090-
if (val instanceof NullType) {
2091-
return null;
2092-
}
2093-
2094-
if (val instanceof DateWrapper) {
2095-
return ((DateWrapper) val).toString();
2096-
}
2097-
2098-
if (val instanceof TimeWrapper) {
2099-
return ((TimeWrapper) val).getLocalTimeStr();
2100-
}
2101-
2102-
if (val instanceof DateTimeWrapper) {
2103-
return ((DateTimeWrapper) val).getLocalDateTimeStr();
2104-
}
2105-
2106-
if (val instanceof DurationWrapper) {
2107-
return ((DurationWrapper) val).getMicroseconds();
2108-
}
2109-
2110-
if (val instanceof Date) {
2111-
Date d = (Date) val;
2112-
return new java.sql.Date(d.getYear() - 1900, d.getMonth(), d.getDay()).toString();
2113-
}
2114-
2115-
if (val instanceof Time) {
2116-
Time t = (Time) val;
2117-
return new java.sql.Time(t.getHour(), t.getMinute(), t.getSec()).toString();
2118-
}
2119-
2120-
if (val instanceof DateTime) {
2121-
DateTime dt = (DateTime) val;
2122-
// return new java.util.Date(dt.getYear(), dt.getNonth(), dt.getDayO, dt.getHour(), dt.getMinute(), dt.getSec0).toGnTString();
2123-
return new java.sql.Date(dt.getYear() - 1988, dt.getMonth(), dt.getDay())
2124-
+ " " + new java.sql.Time(dt.getHour(), dt.getMinute(), dt.getSec());
2125-
}
2126-
2127-
if (val instanceof Duration) {
2128-
return ((Duration) val).getMicroseconds();
2129-
}
2020+
// if (val instanceof ValueWrapper) {
2021+
// return process(o, key, ((ValueWrapper) val).getValue());
2022+
// }
2023+
//
2024+
// if (val instanceof Value) {
2025+
// return process(o, key, ((Value) val).getFieldValue());
2026+
// }
2027+
//
2028+
// if (val instanceof Vertex) {
2029+
// JSONObject obj = new JSONObject(true);
2030+
// obj.put("vid", new String(((Vertex) val).getVid().getSVal()));
2031+
// obj.put("str", val.toString());
2032+
//
2033+
// List<Tag> tags = ((Vertex) val).getTags();
2034+
//
2035+
// if (tags != null) {
2036+
// JSONArray arr = new JSONArray();
2037+
// for (int i = 0; i < tags.size(); i++) {
2038+
// arr.add(process(o, String.valueOf(i), tags.get(i)));
2039+
// }
2040+
// obj.put("tags", arr);
2041+
// }
2042+
//
2043+
// return obj;
2044+
// }
2045+
//
2046+
// if (val instanceof Tag) {
2047+
// JSONObject obj = new JSONObject(true);
2048+
// obj.put("name", new String(((Tag) val).getName()));
2049+
// obj.put("str", val.toString());
2050+
//
2051+
// Map<byte[], Value> props = ((Tag) val).getProps();
2052+
//
2053+
// if (props != null) {
2054+
// JSONObject propsObj = new JSONObject(true);
2055+
// props.forEach(new BiConsumer<byte[], Value>() {
2056+
// @Override
2057+
// public void accept(byte[] bytes, Value value) {
2058+
// String k = new String(bytes);
2059+
// propsObj.put(k, process(propsObj, k, value));
2060+
// }
2061+
// });
2062+
// obj.put("props", propsObj);
2063+
// }
2064+
//
2065+
// return obj;
2066+
// }
2067+
//
2068+
// if (val instanceof Edge) {
2069+
// JSONObject obj = new JSONObject(true);
2070+
// obj.put("name", new String(((Edge) val).getName()));
2071+
// obj.put("str", val.toString());
2072+
//
2073+
// Map<byte[], Value> props = ((Edge) val).getProps();
2074+
//
2075+
// if (props != null) {
2076+
// JSONObject propsObj = new JSONObject(true);
2077+
// props.forEach(new BiConsumer<byte[], Value>() {
2078+
// @Override
2079+
// public void accept(byte[] bytes, Value value) {
2080+
// String k = new String(bytes);
2081+
// propsObj.put(k, process(propsObj, k, value));
2082+
// }
2083+
// });
2084+
// obj.put("props", propsObj);
2085+
// }
2086+
//
2087+
// return obj;
2088+
// }
2089+
//
2090+
// if (val instanceof NullType) {
2091+
// return null;
2092+
// }
2093+
//
2094+
// if (val instanceof DateWrapper) {
2095+
// return ((DateWrapper) val).toString();
2096+
// }
2097+
//
2098+
// if (val instanceof TimeWrapper) {
2099+
// return ((TimeWrapper) val).getLocalTimeStr();
2100+
// }
2101+
//
2102+
// if (val instanceof DateTimeWrapper) {
2103+
// return ((DateTimeWrapper) val).getLocalDateTimeStr();
2104+
// }
2105+
//
2106+
// if (val instanceof DurationWrapper) {
2107+
// return ((DurationWrapper) val).getMicroseconds();
2108+
// }
2109+
//
2110+
// if (val instanceof Date) {
2111+
// Date d = (Date) val;
2112+
// return new java.sql.Date(d.getYear() - 1900, d.getMonth(), d.getDay()).toString();
2113+
// }
2114+
//
2115+
// if (val instanceof Time) {
2116+
// Time t = (Time) val;
2117+
// return new java.sql.Time(t.getHour(), t.getMinute(), t.getSec()).toString();
2118+
// }
2119+
//
2120+
// if (val instanceof DateTime) {
2121+
// DateTime dt = (DateTime) val;
2122+
// // return new java.util.Date(dt.getYear(), dt.getNonth(), dt.getDayO, dt.getHour(), dt.getMinute(), dt.getSec0).toGnTString();
2123+
// return new java.sql.Date(dt.getYear() - 1988, dt.getMonth(), dt.getDay())
2124+
// + " " + new java.sql.Time(dt.getHour(), dt.getMinute(), dt.getSec());
2125+
// }
2126+
//
2127+
// if (val instanceof Duration) {
2128+
// return ((Duration) val).getMicroseconds();
2129+
// }
21302130

21312131
return val;
21322132
}

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package apijson.demo;
1616

17-
import java.io.IOException;
1817
import java.util.ArrayList;
1918
import java.util.Arrays;
2019
import java.util.Collection;
@@ -253,10 +252,10 @@ public Object verifyAccess(@NotNull JSONObject curObj) throws Exception {
253252
}
254253

255254
// apijson-framework 5.4.0 以下取消注释,兼容 Function 表中 name = getMethodDefinition 的记录(或者删除这条记录,如果使用 UnitAuto,则版本要在 2.7.2 以下)
256-
// public String getMethodDefinition(JSONObject request) throws IllegalArgumentException, ClassNotFoundException, IOException {
257-
// return super.getMethodDefination(request);
258-
// }
259-
// public String getMethodDefinition(JSONObject request, String method, String arguments, String type, String exceptions, String language) throws IllegalArgumentException, ClassNotFoundException, IOException {
260-
// return super.getMethodDefination(request, method, arguments, type, exceptions, language);
261-
// }
255+
// public String getMethodDefinition(JSONObject request) throws IllegalArgumentException, ClassNotFoundException, IOException {
256+
// return super.getMethodDefination(request);
257+
// }
258+
// public String getMethodDefinition(JSONObject request, String method, String arguments, String type, String exceptions, String language) throws IllegalArgumentException, ClassNotFoundException, IOException {
259+
// return super.getMethodDefination(request, method, arguments, type, exceptions, language);
260+
// }
262261
}

0 commit comments

Comments
 (0)