Skip to content

Commit b3dbb58

Browse files
committed
Java:APIJSONBootTest 重命名为 APIJSONDemo; APIJSONFinal 中 AppRunnableConfig 重命名为 DemoAppConfig;升级 APIJSONORM 和 apijson-framework 的版本;完善使用文档;
1 parent d5f3200 commit b3dbb58

File tree

25 files changed

+129
-80
lines changed

25 files changed

+129
-80
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ APIJSON-Java-Server/APIJSONBootTest/.settings
66
APIJSON-Java-Server/APIJSONFinal/.settings
77
APIJSON-Java-Server/APIJSONFinal/.idea
88
apijson-final.iml
9+
APIJSON-Java-Server/APIJSONDemo/.settings
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# APIJSONBoot
2+
3+
APIJSON + SpringBoot 接近成品的 Demo
4+
5+
### 运行
6+
7+
右键 DemoApplication > Run As > Java Application
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

APIJSON-Java-Server/APIJSONBoot/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
</dependency>
3939

4040
<!-- 可使用 libs 目录的 apijson-orm.jar 和 apijson-framework.jar 来替代,两种方式二选一 <<<<<<<<<< -->
41-
<dependency>
41+
<dependency>
4242
<groupId>com.github.Tencent</groupId>
4343
<artifactId>APIJSON</artifactId>
44-
<version>4.2.4</version>
44+
<version>4.2.5</version>
4545
</dependency>
4646
<dependency>
4747
<groupId>com.github.APIJSON</groupId>
4848
<artifactId>apijson-framework</artifactId>
49-
<version>4.4.0</version>
49+
<version>4.4.3</version>
5050
</dependency>
5151
<!-- 可使用 libs 目录的 apijson-orm.jar 和 apijson-framework.jar 来替代,两种方式二选一 >>>>>>>>>> -->
5252

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

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ public DemoSQLConfig(RequestMethod method, String table) {
4141
DEFAULT_DATABASE = DATABASE_MYSQL; //TODO 默认数据库类型,改成你自己的
4242
DEFAULT_SCHEMA = "sys"; //TODO 默认模式名,改成你自己的,默认情况是 MySQL: sys, PostgreSQL: public, SQL Server: dbo, Oracle:
4343

44-
// 由 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置
45-
// //表名映射,隐藏真实表名,对安全要求很高的表可以这么做
44+
//表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要;
45+
//这个 Demo 用了 apijson-framework 且调用了 APIJSONApplication.init
46+
//(间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置),所以不需要。
47+
//但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如
48+
// TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access");
49+
50+
//表名映射,隐藏真实表名,对安全要求很高的表可以这么做
4651
// TABLE_KEY_MAP.put(User.class.getSimpleName(), "apijson_user");
4752
// TABLE_KEY_MAP.put(Privacy.class.getSimpleName(), "apijson_privacy");
4853

@@ -72,11 +77,11 @@ public String getUserIdKey(String database, String schema, String table) {
7277
// public Object newId(RequestMethod method, String database, String schema, String table) {
7378
// return null; // return null 则不生成 id,一般用于数据库自增 id
7479
// }
75-
76-
// @Override
77-
// public void onMissingKey4Combine(String name, JSONObject request, String combine, String item, String key) throws Exception {
78-
//// super.onMissingKey4Combine(name, request, combine, item, key);
79-
// }
80+
81+
// @Override
82+
// public void onMissingKey4Combine(String name, JSONObject request, String combine, String item, String key) throws Exception {
83+
//// super.onMissingKey4Combine(name, request, combine, item, key);
84+
// }
8085
};
8186

8287
// 自定义where条件拼接
@@ -161,7 +166,13 @@ public String getDBPassword() {
161166
}
162167
return null;
163168
}
164-
169+
170+
//取消注释后,默认的 APIJSON 配置表会由业务表所在数据库模式 schema 改为自定义的
171+
// @Override
172+
// public String getConfigSchema() {
173+
// return "apijson";
174+
// }
175+
165176
//取消注释后,默认的数据库类型会由 MySQL 改为 PostgreSQL
166177
// @Override
167178
// public String getDatabase() {

APIJSON-Java-Server/APIJSONBootTest/src/main/java/apijson/boot/test/DemoSQLConfig.java

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)