GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 升级自身, apijson-framework 至 5.1.1,升级 apijson-router 至 1.0.1;解决 PostgreS… · hpdx/APIJSON-Demo@6e288c7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • APIJSON-Java-Server
    • APIJSONBoot-MultiDataSource
      • libs
        • apijson-column-1.2.2.jar
        • apijson-framework-5.1.1.jar
        • apijson-orm-5.1.1.jar
        • apijson-router-1.0.1.jar
      • pom.xml
      • src/main
        • java/apijson/demo
          • DemoSQLConfig.java
        • resources/static/js
          • main.js
    • APIJSONBoot
      • libs
        • apijson-column-1.2.2.jar
        • apijson-framework-5.1.1.jar
        • apijson-router-1.0.1.jar
      • pom.xml
      • src/main/java/apijson/demo
        • DemoSQLConfig.java
  • MySQL
    • single
      • sys_Access.sql
      • sys_Comment.sql
      • sys_Document.sql
      • sys_Function.sql
      • sys_Login.sql
      • sys_Method.sql
      • sys_Moment.sql
      • sys_Praise.sql
      • sys_Random.sql
      • sys_Request.sql
      • sys_TestRecord.sql
      • sys_Verify.sql
      • sys__Visit.sql
      • sys_apijson_privacy.sql
      • sys_apijson_user.sql
      • sys_routines.sql
    • sys.sql
  • PostgreSQL/single
    • postgres_sys_Access.sql
    • postgres_sys_Comment.sql
    • postgres_sys_Document.sql
    • postgres_sys_Function.sql
    • postgres_sys_Login.sql
    • postgres_sys_Moment.sql
    • postgres_sys_Praise.sql
    • postgres_sys_Request.sql
    • postgres_sys_Response.sql
    • postgres_sys_Test.sql
    • postgres_sys_TestRecord.sql
    • postgres_sys_Verify.sql
    • postgres_sys_Visit.sql
    • postgres_sys__Visit.sql
    • postgres_sys_apijson_privacy.sql
    • postgres_sys_apijson_user.sql

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-column-1.2.2.jar‎

Copy file name to clipboard
-8.09 KB
Binary file not shown.
Collapse file

‎…aSource/libs/apijson-framework-5.1.0.jar‎ ‎…aSource/libs/apijson-framework-5.1.1.jar‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-framework-5.1.0.jar renamed to APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-framework-5.1.1.jar APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-framework-5.1.0.jar renamed to APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-framework-5.1.1.jar

Copy file name to clipboard
68.1 KB
Binary file not shown.
Collapse file

‎…ltiDataSource/libs/apijson-orm-5.1.0.jar‎ ‎…ltiDataSource/libs/apijson-orm-5.1.1.jar‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-orm-5.1.0.jar renamed to APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-orm-5.1.1.jar APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-orm-5.1.0.jar renamed to APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-orm-5.1.1.jar

Copy file name to clipboard
356 KB
Binary file not shown.
Collapse file

‎…DataSource/libs/apijson-router-1.0.0.jar‎ ‎…DataSource/libs/apijson-router-1.0.1.jar‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-router-1.0.0.jar renamed to APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-router-1.0.1.jar APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-router-1.0.0.jar renamed to APIJSON-Java-Server/APIJSONBoot-MultiDataSource/libs/apijson-router-1.0.1.jar

Copy file name to clipboard
20 KB
Binary file not shown.
Collapse file

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

Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONBoot-MultiDataSource/pom.xml
+20-13Lines changed: 20 additions & 13 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>5.1.0</version>
8+
<version>5.1.1</version>
99
<!-- <packaging>jar</packaging> -->
1010

1111
<name>APIJSONBoot-MultiDataSource</name>
@@ -18,6 +18,13 @@
1818
</properties>
1919

2020
<dependencies>
21+
<!-- JDK 11+ 需要,否则启动报错 NoClassDefFoundError: javax/activation/UnsupportedDataTypeException -->
22+
<dependency>
23+
<groupId>javax.activation</groupId>
24+
<artifactId>activation</artifactId>
25+
<version>1.1.1</version>
26+
</dependency>
27+
2128
<!-- APIJSON 需要用的依赖库,1.2.0 以上 -->
2229
<dependency>
2330
<groupId>com.alibaba</groupId>
@@ -32,7 +39,7 @@
3239
<version>4.0.1</version>
3340
</dependency>
3441

35-
<!-- 单元测试:可使用 libs 目录的 unitauto-java.jar 和 unitauto-jar.jar 来替代,两种方式二选一
42+
<!-- 单元测试:可使用 libs 目录的 unitauto-java.jar 和 unitauto-jar.jar 来替代,两种方式二选一
3643
<<<<<<<<< -->
3744
<dependency>
3845
<groupId>com.github.TommyLemon</groupId>
@@ -47,21 +54,21 @@
4754
<dependency>
4855
<groupId>io.github.classgraph</groupId>
4956
<artifactId>classgraph</artifactId>
50-
<version>4.8.87</version>
57+
<version>4.8.146</version>
5158
</dependency>
5259
<!-- 单元测试:可使用 libs 目录的 unitauto-java.jar 和 unitauto-jar.jar 来替代,两种方式二选一 >>>>>>>>> -->
5360

5461

5562
<!-- 可使用 libs 目录的 apijson-orm.jar, apijson-framework.jar, apijson-column.jar 来替代,两种方式二选一 <<<<<<<<<< -->
56-
<dependency>
63+
<!-- <dependency>
5764
<groupId>com.github.Tencent</groupId>
5865
<artifactId>APIJSON</artifactId>
5966
<version>5.1.0</version>
6067
</dependency>
6168
<dependency>
6269
<groupId>com.github.APIJSON</groupId>
6370
<artifactId>apijson-framework</artifactId>
64-
<version>5.1.0</version>
71+
<version>5.1.1</version>
6572
</dependency>
6673
<dependency>
6774
<groupId>com.github.APIJSON</groupId>
@@ -71,20 +78,20 @@
7178
<dependency>
7279
<groupId>com.github.APIJSON</groupId>
7380
<artifactId>apijson-router</artifactId>
74-
<version>1.0.0</version>
75-
</dependency>
81+
<version>1.0.1</version>
82+
</dependency> -->
7683
<!-- 可使用 libs 目录的 apijson-orm.jar, apijson-framework.jar, apijson-column.jar 来替代,两种方式二选一 >>>>>>>>>> -->
7784

7885
<!-- 需要用的数据库 JDBC 驱动 -->
7986
<dependency>
8087
<groupId>mysql</groupId>
8188
<artifactId>mysql-connector-java</artifactId>
82-
<version>8.0.27</version>
89+
<version>8.0.29</version>
8390
</dependency>
8491
<dependency>
8592
<groupId>org.postgresql</groupId>
8693
<artifactId>postgresql</artifactId>
87-
<version>42.2.18</version>
94+
<version>42.3.4</version>
8895
</dependency>
8996
<dependency>
9097
<groupId>net.sourceforge.jtds</groupId>
@@ -99,23 +106,23 @@
99106
<dependency>
100107
<groupId>org.springframework.boot</groupId>
101108
<artifactId>spring-boot-starter-web</artifactId>
102-
<version>2.4.2</version>
109+
<version>2.6.7</version>
103110
</dependency>
104111

105112
<!-- 需要用的 HikariCP 数据库连接池库,3.1.0 以上 -->
106113
<dependency>
107114
<groupId>com.zaxxer</groupId>
108115
<artifactId>HikariCP</artifactId>
109-
<version>3.1.0</version>
116+
<version>5.0.1</version>
110117
</dependency>
111118

112119
<!-- 需要用的 Druid 数据库连接池库,1.0.29 以上 -->
113120
<dependency>
114121
<groupId>com.alibaba</groupId>
115122
<artifactId>druid</artifactId>
116-
<version>1.0.29</version>
123+
<version>1.2.9</version>
117124
</dependency>
118-
125+
119126
</dependencies>
120127

121128
<build>
Collapse file

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

Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLConfig.java
+12-9Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
/**SQL配置
3939
* TiDB 用法和 MySQL 一致
40-
* 具体见详细的说明文档 C.开发说明 C-1-1.修改数据库链接
40+
* 具体见详细的说明文档 C.开发说明 C-1-1.修改数据库链接
4141
* https://github.com/Tencent/APIJSON/blob/master/%E8%AF%A6%E7%BB%86%E7%9A%84%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3.md#c-1-1%E4%BF%AE%E6%94%B9%E6%95%B0%E6%8D%AE%E5%BA%93%E9%93%BE%E6%8E%A5
4242
* @author Lemon
4343
*/
@@ -52,7 +52,7 @@ public DemoSQLConfig(RequestMethod method, String table) {
5252

5353
static {
5454
DEFAULT_DATABASE = DATABASE_MYSQL; //TODO 默认数据库类型,改成你自己的。TiDB, MariaDB, OceanBase 这类兼容 MySQL 的可当做 MySQL 使用
55-
DEFAULT_SCHEMA = "sys"; //TODO 默认数据库名/模式,改成你自己的,默认情况是 MySQL: sys, PostgreSQL: public, SQL Server: dbo, Oracle:
55+
DEFAULT_SCHEMA = "sys"; //TODO 默认数据库名/模式,改成你自己的,默认情况是 MySQL: sys, PostgreSQL: sys, SQL Server: dbo, Oracle:
5656

5757
//表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要;
5858
//这个 Demo 用了 apijson-framework 且调用了 APIJSONApplication.init
@@ -97,7 +97,11 @@ public String getUserIdKey(String database, String schema, String datasource, St
9797
// }
9898
};
9999

100-
// 自定义原始 SQL 片段,其它功能满足不了时才用它,只有 RAW_MAP 配置了的 key 才允许前端传
100+
// PostgreSQL 表结构相关 SQL 函数,用于 APIAuto 查询和展示文档
101+
SQL_FUNCTION_MAP.put("obj_description", "");
102+
SQL_FUNCTION_MAP.put("col_description", "");
103+
104+
// 自定义原始 SQL 片段,其它功能满足不了时才用它,只有 RAW_MAP 配置了的 key 才允许前端传
101105
RAW_MAP.put("`to`.`id`", ""); // 空字符串 "" 表示用 key 的值 `to`.`id`
102106
RAW_MAP.put("to.momentId", "`to`.`momentId`"); // 最终以 `to`.`userId` 拼接 SQL,相比以上写法可以让前端写起来更简单
103107
RAW_MAP.put("(`Comment`.`userId`=`to`.`userId`)", ""); // 已经是一个条件表达式了,用 () 包裹是为了避免 JSON 中的 key 拼接在前面导致 SQL 出错
@@ -106,9 +110,8 @@ public String getUserIdKey(String database, String schema, String datasource, St
106110
RAW_MAP.put("substring_index(substring_index(content,',',1),',',-1)", ""); // APIAuto 不支持 ',可以用 Postman 测
107111
RAW_MAP.put("substring_index(substring_index(content,'.',1),'.',-1) AS subContent", ""); // APIAuto 不支持 ',可以用 Postman 测
108112
RAW_MAP.put("commentWhereItem1","(`Comment`.`userId` = 38710 AND `Comment`.`momentId` = 470)");
109-
RAW_MAP.put("to_days(now())-to_days(`date`)<=7",""); // 给 @having 使用
110-
RAW_MAP.put("sexShowStr","CASE sex WHEN 0 THEN '男' WHEN 1 THEN '女' ELSE '其它' END"); // 给 @having 使用
111-
113+
RAW_MAP.put("to_days(now())-to_days(`date`)<=7", ""); // 给 @having 使用
114+
RAW_MAP.put("sexShowStr", "CASE sex WHEN 0 THEN '男' WHEN 1 THEN '女' ELSE '其它' END"); // 给 @having 使用
112115

113116
// 取消注释支持 !key 反选字段 和 字段名映射,需要先依赖插件 https://github.com/APIJSON/apijson-column
114117

@@ -286,7 +289,7 @@ public String getDBPassword() {
286289
// preparedValueList.add(value);
287290
// }
288291
// return "to_date(" + (isPrepared() ? "?" : getSQLValue(value)) + ",'yyyy-mm-dd hh24:mi:ss')";
289-
// }
292+
// }
290293
// catch (Throwable e) {
291294
// if (Log.DEBUG) {
292295
// e.printStackTrace();
@@ -295,8 +298,8 @@ public String getDBPassword() {
295298
// }
296299
// return super.getValue(value);
297300
// }
298-
299-
301+
302+
300303
@Override
301304
protected void onGetCrossJoinString(Join j) throws UnsupportedOperationException {
302305
// 开启 CROSS JOIN 笛卡尔积联表 super.onGetCrossJoinString(j);
Collapse file

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/js/main.js‎

Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/js/main.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@
29942994
'randomId': 0,
29952995
'@order': 'date-',
29962996
'@column': 'id,userId,documentId,duration,minDuration,maxDuration,response' + (this.isMLEnabled ? ',standard' : ''),
2997-
'@having': this.isMLEnabled ? 'length(standard)>2' : null //用 MySQL 5.6 '@having': this.isMLEnabled ? 'json_length(standard)>0' : null
2997+
'len{}': this.isMLEnabled ? 'length(standard)>2' : null //用 MySQL 5.6 '@having': this.isMLEnabled ? 'json_length(standard)>0' : null
29982998
}
29992999
},
30003000
'@role': 'LOGIN'
@@ -6248,7 +6248,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
62486248
'host': this.getBaseUrl(),
62496249
'@order': 'date-',
62506250
'@column': 'id,userId,testAccountId,documentId,randomId,duration,minDuration,maxDuration,response' + (this.isMLEnabled ? ',standard' : ''),
6251-
'@having': this.isMLEnabled ? 'length(standard)>2' : null // '@having': this.isMLEnabled ? 'json_length(standard)>0' : null
6251+
'len{}': this.isMLEnabled ? 'length(standard)>2' : null // '@having': this.isMLEnabled ? 'json_length(standard)>0' : null
62526252
}
62536253
}, {}, function (url, res, err) {
62546254
App.onResponse(url, res, err)
Collapse file

‎APIJSON-Java-Server/APIJSONBoot/libs/apijson-column-1.2.2.jar‎

Copy file name to clipboard
-8.09 KB
Binary file not shown.
Collapse file

‎…SONBoot/libs/apijson-framework-5.1.0.jar‎ ‎…SONBoot/libs/apijson-framework-5.1.1.jar‎APIJSON-Java-Server/APIJSONBoot/libs/apijson-framework-5.1.0.jar renamed to APIJSON-Java-Server/APIJSONBoot/libs/apijson-framework-5.1.1.jar APIJSON-Java-Server/APIJSONBoot/libs/apijson-framework-5.1.0.jar renamed to APIJSON-Java-Server/APIJSONBoot/libs/apijson-framework-5.1.1.jar

Copy file name to clipboard
68.1 KB
Binary file not shown.
Collapse file

‎APIJSON-Java-Server/APIJSONBoot/libs/apijson-router-1.0.1.jar‎

Copy file name to clipboard
20.1 KB
Binary file not shown.

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.