GeezerVison is showing github.com — Java:升级所有 Demo 依赖 APIJSON 5.3.0, apijson-framework 5.3.0, apijson-col… · HarryLiIsMe/APIJSON-Demo@aba6515
File treeExpand file treeCollapse file tree Open diff view settings APIJSONBoot-MultiDataSource/src/main/java/apijson/boot src/main/java/apijson/demo
src/main/java/apijson/demo
src/main/java/apijson/demo
src/main/java/apijson/demo
src/main/java/apijson/demo
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1358,11 +1358,11 @@ else if (APIJSON_DELEGATE_ID.toLowerCase().equals(name.toLowerCase())) { | 1358 | 1358 | } | 1359 | 1359 | * </pre> | 1360 | 1360 | */ | 1361 | | - @PostMapping("execute") | | 1361 | + @PostMapping("sql/execute") | 1362 | 1362 | public String execute(@RequestBody String request, HttpSession session) { | 1363 | 1363 | try { | 1364 | 1364 | if (Log.DEBUG == false) { | 1365 | | - return DemoParser.newErrorResult(new IllegalAccessException("非 DEBUG 模式下不允许调用 /execute !")).toJSONString(); | | 1365 | + return DemoParser.newErrorResult(new IllegalAccessException("非 DEBUG 模式下不允许调用 /sql/execute !")).toJSONString(); | 1366 | 1366 | } | 1367 | 1367 |
| 1368 | 1368 | DemoVerifier.verifyLogin(session); | @@ -2035,39 +2035,39 @@ public void invokeMethod(@RequestBody String request, HttpServletRequest servlet | 2035 | 2035 |
| 2036 | 2036 | // 为 APIAuto, UnitAuto, SQLAuto 提供的后台 Headless 无 UI 测试转发接口 <<<<<<<<<<<<<<<<<<<<<<<<<<< | 2037 | 2037 |
| 2038 | | - @GetMapping("/api/test/start") | | 2038 | + @GetMapping("api/test/start") | 2039 | 2039 | public String startApiTest(HttpSession session) { | 2040 | 2040 | //response.sendRedirect("http://localhost:3000/test/start"); | 2041 | 2041 | long id = 100000 + Math.round(899999*Math.random()); | 2042 | 2042 | DemoParser.KEY_MAP.put(String.valueOf(id), session); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id); | 2043 | 2043 | return delegate("http://localhost:3000/test/start?key=" + id, null, null, null, null, HttpMethod.GET, session); | 2044 | 2044 | } | 2045 | | - @GetMapping("/api/test/status") | | 2045 | + @GetMapping("api/test/status") | 2046 | 2046 | public String getApiTestStatus(@RequestParam(value = "key", required = false) String key, HttpSession session) { | 2047 | 2047 | //response.sendRedirect("http://localhost:3000/test/status"); | 2048 | 2048 | DemoParser.KEY_MAP.remove(key); | 2049 | 2049 | return delegate("http://localhost:3000/test/status", null, null, null, null, HttpMethod.GET, session); | 2050 | 2050 | } | 2051 | 2051 |
| 2052 | | - @GetMapping("/unit/test/start") | | 2052 | + @GetMapping("unit/test/start") | 2053 | 2053 | public String startUnitTest(HttpSession session) { | 2054 | 2054 | long id = 100000 + Math.round(899999*Math.random()); | 2055 | 2055 | DemoParser.KEY_MAP.put(String.valueOf(id), session); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id); | 2056 | 2056 | return delegate("http://localhost:3001/test/start?key=" + id, null, null, null, null, HttpMethod.GET, session); | 2057 | 2057 | } | 2058 | | - @GetMapping("/unit/test/status") | | 2058 | + @GetMapping("unit/test/status") | 2059 | 2059 | public String getUnitTestStatus(@RequestParam(value = "key", required = false) String key, HttpSession session) { | 2060 | 2060 | DemoParser.KEY_MAP.remove(key); | 2061 | 2061 | return delegate("http://localhost:3001/test/status", null, null, null, null, HttpMethod.GET, session); | 2062 | 2062 | } | 2063 | 2063 |
| 2064 | | - @GetMapping("/sql/test/start") | | 2064 | + @GetMapping("sql/test/start") | 2065 | 2065 | public String startSQLTest(HttpSession session) { | 2066 | 2066 | long id = 100000 + Math.round(899999*Math.random()); | 2067 | 2067 | DemoParser.KEY_MAP.put(String.valueOf(id), session); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id); | 2068 | 2068 | return delegate("http://localhost:3002/test/start?key=" + id, null, null, null, null, HttpMethod.GET, session); | 2069 | 2069 | } | 2070 | | - @GetMapping("/sql/test/status") | | 2070 | + @GetMapping("sql/test/status") | 2071 | 2071 | public String getSQLTestStatus(@RequestParam("key") String key, HttpSession session) { | 2072 | 2072 | DemoParser.KEY_MAP.remove(key); | 2073 | 2073 | return delegate("http://localhost:3002/test/status", null, null, null, null, HttpMethod.GET, session); | |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONBoot/pom.xml +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 5 | 5 |
| 6 | 6 | <groupId>apijson.boot</groupId> | 7 | 7 | <artifactId>apijson-boot</artifactId> | 8 | | - <version>5.2.0</version> | | 8 | + <version>5.3.0</version> | 9 | 9 | <packaging>jar</packaging> | 10 | 10 |
| 11 | 11 | <name>APIJSONBoot</name> | | 62 | 62 | <dependency> | 63 | 63 | <groupId>com.github.Tencent</groupId> | 64 | 64 | <artifactId>APIJSON</artifactId> | 65 | | - <version>5.2.0</version> | | 65 | + <version>5.3.0</version> | 66 | 66 | </dependency> | 67 | 67 | <dependency> | 68 | 68 | <groupId>com.github.APIJSON</groupId> | 69 | 69 | <artifactId>apijson-framework</artifactId> | 70 | | - <version>5.2.0</version> | | 70 | + <version>5.3.0</version> | 71 | 71 | </dependency> | 72 | 72 | <dependency> | 73 | 73 | <groupId>com.github.APIJSON</groupId> | 74 | 74 | <artifactId>apijson-column</artifactId> | 75 | | - <version>1.2.5</version> | | 75 | + <version>1.2.7</version> | 76 | 76 | </dependency> | 77 | 77 | <!-- 可使用 libs 目录的 apijson-orm.jar, apijson-framework.jar, apijson-column.jar 来替代,两种方式二选一 >>>>>>>>>> --> | 78 | 78 |
| |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/DemoSQLConfig.java +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -54,11 +54,11 @@ public DemoSQLConfig(RequestMethod method, String table) { | 54 | 54 | DEFAULT_DATABASE = DATABASE_MYSQL; //TODO 默认数据库类型,改成你自己的。TiDB, MariaDB, OceanBase 这类兼容 MySQL 的可当做 MySQL 使用 | 55 | 55 | DEFAULT_SCHEMA = "sys"; //TODO 默认数据库名/模式,改成你自己的,默认情况是 MySQL: sys, PostgreSQL: sys, SQL Server: dbo, Oracle: | 56 | 56 |
| 57 | | - // 表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要; | 58 | | - // 这个 Demo 用了 apijson-framework 且调用了 APIJSONApplication.init | 59 | | - // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置),所以不需要。 | 60 | | - // 但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如 | 61 | | - // TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access"); | | 57 | + // 表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要; | | 58 | + // 如果用了 apijson-framework 且调用了 APIJSONApplication.init 则不需要 | | 59 | + // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置)。 | | 60 | + // 但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如 | | 61 | + // TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access"); | 62 | 62 |
| 63 | 63 | // 表名映射,隐藏真实表名,对安全要求很高的表可以这么做 | 64 | 64 | // TABLE_KEY_MAP.put(User.class.getSimpleName(), "apijson_user"); | |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONDemo-Druid/pom.xml +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 5 | 5 |
| 6 | 6 | <groupId>apijson.demo</groupId> | 7 | 7 | <artifactId>apijson-demo-druid</artifactId> | 8 | | - <version>5.2.0</version> | | 8 | + <version>5.3.0</version> | 9 | 9 | <packaging>jar</packaging> | 10 | 10 |
| 11 | 11 | <name>APIJSONDemo-Druid</name> | | 29 | 29 | <dependency> | 30 | 30 | <groupId>com.github.APIJSON</groupId> | 31 | 31 | <artifactId>apijson-framework</artifactId> | 32 | | - <version>5.2.0</version> | | 32 | + <version>5.3.0</version> | 33 | 33 | </dependency> | 34 | 34 |
| 35 | 35 | <!-- 需要用的数据库 JDBC 驱动 --> | |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONDemo-Druid/src/main/java/apijson/demo/DemoSQLConfig.java +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -29,11 +29,11 @@ public class DemoSQLConfig extends APIJSONSQLConfig { | 29 | 29 | DEFAULT_DATABASE = DATABASE_MYSQL; // TODO 默认数据库类型,改成你自己的 | 30 | 30 | DEFAULT_SCHEMA = "sys"; // TODO 默认数据库名/模式,改成你自己的,默认情况是 MySQL: sys, PostgreSQL: public, SQL Server: dbo, Oracle: | 31 | 31 |
| 32 | | - // 表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要; | 33 | | - // 如果用了 apijson-framework 且调用了 APIJSONApplication.init | 34 | | - // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置),则不需要。 | 35 | | - // 但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如 | 36 | | - // TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access"); | | 32 | + // 表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要; | | 33 | + // 如果用了 apijson-framework 且调用了 APIJSONApplication.init 则不需要 | | 34 | + // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置)。 | | 35 | + // 但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如 | | 36 | + // TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access"); | 37 | 37 |
| 38 | 38 | //表名映射,隐藏真实表名,对安全要求很高的表可以这么做 | 39 | 39 | TABLE_KEY_MAP.put("User", "apijson_user"); | |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONDemo-HikariCP/pom.xml +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 5 | 5 |
| 6 | 6 | <groupId>apijson.demo</groupId> | 7 | 7 | <artifactId>apijson-demo-hikaricp</artifactId> | 8 | | - <version>5.2.0</version> | | 8 | + <version>5.3.0</version> | 9 | 9 | <packaging>jar</packaging> | 10 | 10 |
| 11 | 11 | <name>APIJSONDemo</name> | | 29 | 29 | <dependency> | 30 | 30 | <groupId>com.github.APIJSON</groupId> | 31 | 31 | <artifactId>apijson-framework</artifactId> | 32 | | - <version>5.2.0</version> | | 32 | + <version>5.3.0</version> | 33 | 33 | </dependency> | 34 | 34 |
| 35 | 35 | <!-- 需要用的数据库 JDBC 驱动 --> | |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONDemo-HikariCP/src/main/java/apijson/demo/DemoSQLConfig.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,8 +30,8 @@ public class DemoSQLConfig extends APIJSONSQLConfig { | 30 | 30 | DEFAULT_SCHEMA = "sys"; // TODO 默认数据库名/模式,改成你自己的,默认情况是 MySQL: sys, PostgreSQL: public, SQL Server: dbo, Oracle: | 31 | 31 |
| 32 | 32 | // 表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要; | 33 | | - // 如果用了 apijson-framework 且调用了 APIJSONApplication.init | 34 | | - // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置),则不需要。 | | 33 | + // 如果用了 apijson-framework 且调用了 APIJSONApplication.init 则不需要 | | 34 | + // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置)。 | 35 | 35 | // 但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如 | 36 | 36 | // TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access"); | 37 | 37 |
| |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONDemo/pom.xml +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 5 | 5 |
| 6 | 6 | <groupId>apijson.demo</groupId> | 7 | 7 | <artifactId>apijson-demo</artifactId> | 8 | | - <version>5.2.0</version> | | 8 | + <version>5.3.0</version> | 9 | 9 |
| 10 | 10 | <name>APIJSONDemo</name> | 11 | 11 | <description>Demo project for Testing APIJSON Server based on SpringBoot</description> | | 28 | 28 | <dependency> | 29 | 29 | <groupId>com.github.APIJSON</groupId> | 30 | 30 | <artifactId>apijson-framework</artifactId> | 31 | | - <version>5.2.0</version> | | 31 | + <version>5.3.0</version> | 32 | 32 | </dependency> | 33 | 33 |
| 34 | 34 | <!-- 需要用的数据库 JDBC 驱动 --> | |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONDemo/src/main/java/apijson/demo/DemoSQLConfig.java +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -31,11 +31,11 @@ public class DemoSQLConfig extends APIJSONSQLConfig { | 31 | 31 | DEFAULT_DATABASE = DATABASE_MYSQL; // TODO 默认数据库类型,改成你自己的 | 32 | 32 | DEFAULT_SCHEMA = "sys"; // TODO 默认数据库名/模式,改成你自己的,默认情况是 MySQL: sys, PostgreSQL: public, SQL Server: dbo, Oracle: | 33 | 33 |
| 34 | | - // 表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要; | 35 | | - // 如果用了 apijson-framework 且调用了 APIJSONApplication.init | 36 | | - // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置),则不需要。 | 37 | | - // 但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如 | 38 | | - // TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access"); | | 34 | + // 表名和数据库不一致的,需要配置映射关系。只使用 APIJSONORM 时才需要; | | 35 | + // 如果用了 apijson-framework 且调用了 APIJSONApplication.init 则不需要 | | 36 | + // (间接调用 DemoVerifier.init 方法读取数据库 Access 表来替代手动输入配置)。 | | 37 | + // 但如果 Access 这张表的对外表名与数据库实际表名不一致,仍然需要这里注册。例如 | | 38 | + // TABLE_KEY_MAP.put(Access.class.getSimpleName(), "access"); | 39 | 39 |
| 40 | 40 | //表名映射,隐藏真实表名,对安全要求很高的表可以这么做 | 41 | 41 | TABLE_KEY_MAP.put("User", "apijson_user"); | |
Collapse file Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/pom.xml +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | <groupId>apijson.jfinal</groupId> | 5 | 5 | <artifactId>apijson-final</artifactId> | 6 | 6 | <packaging>jar</packaging> | 7 | | - <version>5.2.0</version> | | 7 | + <version>5.3.0</version> | 8 | 8 | <name>Demo project for APIJSON Server based on JFinal</name> | 9 | 9 | <url>http://maven.apache.org</url> | 10 | 10 | <dependencies> | | 33 | 33 | <dependency> | 34 | 34 | <groupId>com.github.Tencent</groupId> | 35 | 35 | <artifactId>APIJSON</artifactId> | 36 | | - <version>5.2.0</version> | | 36 | + <version>5.3.0</version> | 37 | 37 | </dependency> | 38 | 38 | <dependency> | 39 | 39 | <groupId>com.github.APIJSON</groupId> | 40 | 40 | <artifactId>apijson-framework</artifactId> | 41 | | - <version>5.2.0</version> | | 41 | + <version>5.3.0</version> | 42 | 42 | </dependency> | 43 | 43 | <!-- 可使用 libs 目录的 apijson-orm.jar 和 apijson-framework.jar 来替代,两种方式二选一 >>>>>>>>>> --> | 44 | 44 |
| |
|