Skip to content

Commit 792acb7

Browse files
committed
Java:完善 ShardingSphere Demo 的代码、配置、数据,并升级 JDK 17,APIJSON 7.1.0, apijson-framework 7.1.5
1 parent 43f412d commit 792acb7

22 files changed

+649
-421
lines changed

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_1_single/ds_1_Comment_0.sql

Lines changed: 59 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_1_single/ds_1_Comment_1.sql

Lines changed: 59 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_1_single/ds_1_Moment_0.sql

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_1_single/ds_1_Moment_1.sql

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_1_single/ds_1_apijson_user.sql

Lines changed: 59 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_2_single/ds_2_Comment_0.sql

Lines changed: 59 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_2_single/ds_2_Comment_1.sql

Lines changed: 59 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/MySQL/ds_2_single/ds_2_apijson_user.sql

Lines changed: 59 additions & 0 deletions
Large diffs are not rendered by default.

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/pom.xml

Lines changed: 72 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,37 @@
55

66
<groupId>apijson.demo</groupId>
77
<artifactId>apijson-demo</artifactId>
8-
<version>7.0.3</version>
8+
<version>7.1.5</version>
99

1010
<name>APIJSONDemo-SharingSphere</name>
1111
<description>Demo project for testing APIJSON server based on SpringBoot</description>
1212

1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
16-
<java.version>1.8</java.version>
16+
<java.version>17</java.version>
17+
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
18+
<maven.compiler.source>17</maven.compiler.source>
19+
<maven.compiler.target>17</maven.compiler.target>
1720
</properties>
1821

1922
<dependencies>
2023
<!-- 需要的 APIJSON 相关依赖 -->
2124
<dependency>
2225
<groupId>com.github.Tencent</groupId>
2326
<artifactId>APIJSON</artifactId>
24-
<version>7.0.3</version>
27+
<version>7.1.0</version>
2528
</dependency>
2629
<dependency>
2730
<groupId>com.github.APIJSON</groupId>
2831
<artifactId>apijson-framework</artifactId>
29-
<version>7.0.3</version>
32+
<version>7.1.5</version>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>jakarta.servlet</groupId>
37+
<artifactId>jakarta.servlet-api</artifactId>
38+
<version>6.0.0</version>
3039
</dependency>
3140

3241
<!-- 需要用的数据库 JDBC 驱动 -->
@@ -43,18 +52,68 @@
4352
<version>3.1.0</version>
4453
</dependency>
4554

46-
<dependency>
47-
<groupId>org.apache.shardingsphere</groupId>
48-
<artifactId>shardingsphere-jdbc-core</artifactId>
49-
<version>5.2.1</version>
50-
</dependency>
55+
<dependency>
56+
<groupId>org.apache.shardingsphere</groupId>
57+
<artifactId>shardingsphere-jdbc-core</artifactId>
58+
<version>5.4.1</version>
59+
</dependency>
5160
<!-- Oracle, SQLServer 等其它数据库的 JDBC 驱动,可以在这里加上 Maven 依赖或 libs 目录放 Jar 包并依赖 -->
5261

62+
<dependency>
63+
<groupId>org.yaml</groupId>
64+
<artifactId>snakeyaml</artifactId>
65+
<version>1.33</version>
66+
</dependency>
67+
68+
<!-- <dependency>-->
69+
<!-- <groupId>org.slf4j</groupId>-->
70+
<!-- <artifactId>slf4j-api</artifactId>-->
71+
<!-- <version>2.0.13</version>-->
72+
<!-- </dependency>-->
73+
<!-- <dependency>-->
74+
<!-- <groupId>org.slf4j</groupId>-->
75+
<!-- <artifactId>slf4j-log4j12</artifactId>-->
76+
<!-- <version>2.0.13</version>-->
77+
<!-- </dependency>-->
78+
<!-- logback -->
79+
<!-- <dependency>-->
80+
<!-- <groupId>ch.qos.logback</groupId>-->
81+
<!-- <artifactId>logback-classic</artifactId>-->
82+
<!-- <version>1.5.6</version>-->
83+
<!-- </dependency>-->
84+
<!-- <dependency>-->
85+
<!-- <groupId>ch.qos.logback</groupId>-->
86+
<!-- <artifactId>logback-core</artifactId>-->
87+
<!-- <version>1.5.6</version>-->
88+
<!-- </dependency>-->
89+
5390
<!-- 需要用的 SpringBoot 框架,1.4.0 以上 -->
5491
<dependency>
5592
<groupId>org.springframework.boot</groupId>
5693
<artifactId>spring-boot-starter-web</artifactId>
57-
<version>2.5.13</version>
94+
<version>2.7.0</version>
95+
<exclusions>
96+
<!-- <exclusion>-->
97+
<!-- <groupId>org.slf4j</groupId>-->
98+
<!-- <artifactId>slf4j-api</artifactId>-->
99+
<!-- </exclusion>-->
100+
<!-- <exclusion>-->
101+
<!-- <groupId>org.slf4j</groupId>-->
102+
<!-- <artifactId>slf4j-log4j12</artifactId>-->
103+
<!-- </exclusion>-->
104+
<!-- <exclusion>-->
105+
<!-- <groupId>ch.qos.logback</groupId>-->
106+
<!-- <artifactId>logback-classic</artifactId>-->
107+
<!-- </exclusion>-->
108+
<!-- <exclusion>-->
109+
<!-- <groupId>ch.qos.logback</groupId>-->
110+
<!-- <artifactId>logback-core</artifactId>-->
111+
<!-- </exclusion>-->
112+
<!-- <exclusion>-->
113+
<!-- <groupId>org.slf4j</groupId>-->
114+
<!-- <artifactId>slf4j-simple</artifactId>-->
115+
<!-- </exclusion>-->
116+
</exclusions>
58117
</dependency>
59118

60119
</dependencies>
@@ -64,7 +123,7 @@
64123
<plugin>
65124
<groupId>org.springframework.boot</groupId>
66125
<artifactId>spring-boot-maven-plugin</artifactId>
67-
<version>2.5.13</version>
126+
<version>3.2.5</version>
68127
<executions>
69128
<execution>
70129
<goals>
@@ -78,8 +137,8 @@
78137
<artifactId>maven-compiler-plugin</artifactId>
79138
<version>3.8.1</version>
80139
<configuration>
81-
<source>1.8</source>
82-
<target>1.8</target>
140+
<source>17</source>
141+
<target>17</target>
83142
</configuration>
84143
</plugin>
85144
</plugins>

APIJSON-Java-Server/APIJSONDemo-ShardingSphere/src/main/java/apijson/demo/DemoApplication.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
2828

2929
import apijson.Log;
30-
import apijson.framework.APIJSONApplication;
31-
import apijson.framework.APIJSONCreator;
30+
import apijson.framework.javax.APIJSONApplication;
31+
import apijson.framework.javax.APIJSONCreator;
3232
import apijson.orm.SQLConfig;
3333
import apijson.orm.SQLExecutor;
3434

@@ -68,7 +68,7 @@ public void customize(ConfigurableServletWebServerFactory server) {
6868

6969
// 支持 APIAuto 中 JavaScript 代码跨域请求
7070
@Bean
71-
public WebMvcConfigurer corsConfigurer() {
71+
public WebMvcConfigurer corsConfig() {
7272
return new WebMvcConfigurer() {
7373
@Override
7474
public void addCorsMappings(CorsRegistry registry) {
@@ -85,12 +85,12 @@ public void addCorsMappings(CorsRegistry registry) {
8585
// 使用本项目的自定义处理类
8686
APIJSONApplication.DEFAULT_APIJSON_CREATOR = new APIJSONCreator<Long>() {
8787
@Override
88-
public SQLConfig createSQLConfig() {
88+
public SQLConfig<Long> createSQLConfig() {
8989
return new DemoSQLConfig();
9090
}
9191

9292
@Override
93-
public SQLExecutor createSQLExecutor() {
93+
public SQLExecutor<Long> createSQLExecutor() {
9494
return new DemoSQLExecutor();
9595
}
9696
};

0 commit comments

Comments
 (0)