From 6d5363c419b35c3709e46c324cc196d07976e01f Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Sun, 13 Sep 2026 22:31:52 +0800 Subject: [PATCH 01/26] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 36a88031..e26208a8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # APIJSON-Demo -[APIJSON](https://github.com/Tencent/APIJSON) 各种语言(Java, Swift, JavaScript, Python 等)、各种框架(SpringBoot, JFinal 等)、各种客户端(Web, Android, iOS 等) 的 使用示例项目、上手文档、测试数据 SQL 文件 等。
-Demo projects with document and SQL files for [APIJSON](https://github.com/Tencent/APIJSON) with different programming languages, different frameworks and different clients. +[APIJSON](https://github.com/APIJSON/APIJSON) 各种语言(Java, Swift, JavaScript, Python 等)、各种框架(SpringBoot, JFinal 等)、各种客户端(Web, Android, iOS 等) 的 使用示例项目、上手文档、测试数据 SQL 文件 等。
+Demo projects with document and SQL files for [APIJSON](https://github.com/APIJSON/APIJSON) with different programming languages, different frameworks and different clients.
@@ -15,8 +15,8 @@ Demo projects with document and SQL files for [APIJSON](https://github.com/Tence 可以跳过这个步骤,直接用 APIJSON 官网服务器地址 apijson.cn:8080 来测试接口。
You can skip this step and use 'apijson.cn:8080'.
-见  [APIJSON 后端上手 - Java](https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server)
-See https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/README-English.md
+见  [APIJSON 后端上手 - Java](/APIJSON-Java-Server)
+See [Java Server](/APIJSON-Java-Server/README-English.md)
#### 2.前端上手 @@ -25,8 +25,8 @@ See https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/READ 可以跳过这个步骤,直接使用 [APIAuto-机器学习 HTTP 接口工具](https://github.com/TommyLemon/APIAuto) 或 下载客户端 App。
You can skip this step and use [APIAuto](https://github.com/TommyLemon/APIAuto) or download App.
-见  [Android](https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Android)  或  [iOS](https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-iOS)  或  [JavaScript](https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-JavaScript)
-See [Android](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Android/README-English.md), [iOS](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-iOS/README-English.md) or [JavaScript](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-JavaScript/README-English.md)
+见  [Android](/APIJSON-Android)  或  [iOS](/APIJSON-iOS)  或  [JavaScript](/APIJSON-JavaScript)
+See [Android](/APIJSON-Android/README-English.md), [iOS](/APIJSON-iOS/README-English.md) or [JavaScript](/APIJSON-JavaScript/README-English.md)
#### 下载客户端 App #### Download App @@ -41,9 +41,9 @@ Complex production App like Twitter tweets


-有问题可以去 Tencent/APIJSON 提 issue
-If you have any question, please create a issue on Tencent/APIJSON
-https://github.com/Tencent/APIJSON/issues +有问题可以去 APIJSON 主项目提 issue
+If you have any question, please create a issue on the APIJSON core project
+https://github.com/APIJSON/APIJSON/issues ### 贡献者 ### Contributors From b2f58fcdeaf91c31d2093044d891678c0179ca9e Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Sun, 13 Sep 2026 22:50:07 +0800 Subject: [PATCH 02/26] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e26208a8..1a821be3 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,7 @@ https://github.com/APIJSON/APIJSON/issues 2 个腾讯工程师、1 个字节跳动工程师、1 个平安科技工程师、Solon 框架作者 等,感谢大家的贡献~
2 Tencent engineers, 1 ByteDance engineer, 1 Ping An engineer、the author of Solon, etc. Thank you all~
https://github.com/APIJSON/APIJSON-Demo/graphs/contributors + +#### 创作不易、坚持更难,右上角点亮 ⭐Star 收藏/支持一下,谢谢 ^_^ +#### Please ⭐Star this project ^_^ +https://github.com/APIJSON/APIJSON-Demo From 259284c719d131abafa0b523c51d469774b6cad8 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:22:21 +0800 Subject: [PATCH 03/26] Create maven.yml --- .github/workflows/maven.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..f3705641 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,35 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: cd APIJSON-Java-Server/APIJSONBoot-MultiDataSource && mvn -B package --file pom.xml + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 From 74f2b560cbaa9044842273844605d6d6005d35e0 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:23:05 +0800 Subject: [PATCH 04/26] Create swift.yml --- .github/workflows/swift.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/swift.yml diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 00000000..ab134d00 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,22 @@ +# This workflow will build a Swift project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift + +name: Swift + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - name: Build + run: cd APIJSON-iOS && swift build -v + - name: Run tests + run: cd APIJSON-iOS && swift test -v From 825663f9602122a4c2b15cb5de3c09c3c7688486 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:28:54 +0800 Subject: [PATCH 05/26] Update maven.yml --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f3705641..588db6bc 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -31,5 +31,5 @@ jobs: run: cd APIJSON-Java-Server/APIJSONBoot-MultiDataSource && mvn -B package --file pom.xml # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - - name: Update dependency graph - uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 + # - name: Update dependency graph + # uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 From 99061e72d1fa922da3ba64f40ba9b1591df0728a Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:30:12 +0800 Subject: [PATCH 06/26] Update maven.yml --- .github/workflows/maven.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 588db6bc..94a4df45 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -11,8 +11,12 @@ name: Java CI with Maven on: push: branches: [ "main" ] + paths: + - 'APIJSON-Java-Server/APIJSONBoot-MultiDataSource/**' pull_request: branches: [ "main" ] + paths: + - 'APIJSON-Java-Server/APIJSONBoot-MultiDataSource/**' jobs: build: From b4691548e2d5358e771c985ed6b90b520f016719 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:31:46 +0800 Subject: [PATCH 07/26] Update swift.yml --- .github/workflows/swift.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index ab134d00..34d35e56 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build - run: cd APIJSON-iOS && swift build -v + working-directory: APIJSON-iOS + run: swift build -v - name: Run tests - run: cd APIJSON-iOS && swift test -v + working-directory: APIJSON-iOS + run: swift test -v From 732353db0eb2a7ec0a6e3351fa95aa443c21dac4 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:33:32 +0800 Subject: [PATCH 08/26] Update swift.yml --- .github/workflows/swift.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 34d35e56..2af1b0c7 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -17,8 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build - working-directory: APIJSON-iOS + working-directory: APIJSON-iOS/APIJSON-Swift run: swift build -v - name: Run tests - working-directory: APIJSON-iOS + working-directory: APIJSON-iOS/APIJSON-Swift run: swift test -v From 438bc1015c169a7c884f882b82a9504ad1256683 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:35:34 +0800 Subject: [PATCH 09/26] Create android.yml --- .github/workflows/android.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 00000000..9b966474 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,28 @@ +name: Android CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + working-directory: APIJSON-Android/APIJSONApp + run: chmod +x gradlew + - name: Build with Gradle + working-directory: APIJSON-Android/APIJSONApp + run: ./gradlew build From d35914b82caa767be3f1d84e083b8fad6b8bd3fd Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:37:08 +0800 Subject: [PATCH 10/26] Update swift.yml --- .github/workflows/swift.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 2af1b0c7..f5365221 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -6,8 +6,12 @@ name: Swift on: push: branches: [ "main" ] + paths: + - 'APIJSON-iOS/APIJSON-Swift/**' pull_request: branches: [ "main" ] + paths: + - 'APIJSON-iOS/APIJSON-Swift/**' jobs: build: From 9b5ef301595f2a614cb0cb25a1969473115a0206 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Wed, 7 Oct 2026 17:37:37 +0800 Subject: [PATCH 11/26] Update android.yml --- .github/workflows/android.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 9b966474..6c465492 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -3,8 +3,12 @@ name: Android CI on: push: branches: [ "main" ] + paths: + - 'APIJSON-Android/APIJSONApp/**' pull_request: branches: [ "main" ] + paths: + - 'APIJSON-Android/APIJSONApp/**' jobs: build: From 275eef0f97f32ba876b9e06f1ae5a7d57500c4a0 Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Wed, 7 Oct 2026 23:42:06 +0800 Subject: [PATCH 12/26] =?UTF-8?q?Java:=20MultiDataSource=20=E5=86=85=20API?= =?UTF-8?q?Auto=EF=BC=9AJSONResponse=20=E6=96=B0=E5=A2=9E=20IGNORE=5FKEYS?= =?UTF-8?q?=20=E5=BF=BD=E7=95=A5=E5=AD=97=E6=AE=B5=E3=80=81UPGRADE=5FKEYS?= =?UTF-8?q?=20=E8=AD=A6=E5=91=8A=E5=8D=87=E7=BA=A7=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E3=80=81DOWNGRADE=5FKEYS=20=E8=AD=A6=E5=91=8A=E9=99=8D?= =?UTF-8?q?=E7=BA=A7=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=8A=8A=20null,=200,=20''?= =?UTF-8?q?=20=E5=8D=95=E7=8B=AC=E5=88=A4=E7=A9=BA=E8=80=8C=E4=B8=8D?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E8=8C=83=E5=9B=B4=E6=B3=9B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/apijson/boot/DemoController.java | 2 +- .../java/apijson/demo/DemoFunctionParser.java | 2 +- .../main/java/apijson/demo/DemoParser.java | 2 +- .../main/java/apijson/demo/DemoSQLConfig.java | 2 +- .../java/apijson/demo/DemoSQLExecutor.java | 2 +- .../main/java/apijson/demo/DemoVerifier.java | 2 +- .../src/main/resources/static/api/README.md | 8 +-- .../static/api/apijson/JSONResponse.js | 63 ++++++++++++++----- .../src/main/resources/static/api/index.html | 11 ++-- .../src/main/resources/static/api/js/main.js | 30 +++++---- .../src/main/resources/static/au/README.md | 6 +- .../src/main/resources/static/au/index.html | 6 +- .../src/main/resources/static/au/js/main.js | 20 +++--- .../src/main/resources/static/cv/README.md | 6 +- .../src/main/resources/static/cv/index.html | 6 +- .../src/main/resources/static/cv/js/main.js | 20 +++--- .../src/main/resources/static/index.html | 4 +- .../src/main/resources/static/sql/README.md | 6 +- .../src/main/resources/static/sql/index.html | 8 +-- .../src/main/resources/static/sql/js/main.js | 20 +++--- .../src/main/resources/static/ui/index.html | 8 +-- .../src/main/resources/static/ui/js/main.js | 14 ++--- .../src/main/resources/static/unit/index.html | 8 +-- .../src/main/resources/static/unit/js/main.js | 18 +++--- 24 files changed, 153 insertions(+), 121 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java index cf11d01d..94c1a5bc 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java @@ -95,7 +95,7 @@ * 具体见 SpringBoot 文档 * https://www.springcloud.cc/spring-boot.html#boot-features-spring-mvc * 以及 APIJSON 通用文档 3.设计规范 3.1 操作方法 - * https://github.com/Tencent/APIJSON/blob/master/Document.md#3.1 + * https://github.com/APIJSON/APIJSON/blob/main/Document.md#3.1 *
建议全通过HTTP POST来请求: *
1.减少代码 - 客户端无需写HTTP GET,PUT等各种方式的请求代码 *
2.提高性能 - 无需URL encode和decode diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoFunctionParser.java b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoFunctionParser.java index 773837ab..0024f4d7 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoFunctionParser.java +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoFunctionParser.java @@ -37,7 +37,7 @@ /**可远程调用的函数类,用于自定义业务逻辑处理 - * 具体见 https://github.com/Tencent/APIJSON/issues/101 + * 具体见 https://github.com/APIJSON/APIJSON/issues/101 * @author Lemon */ public class DemoFunctionParser extends APIJSONFunctionParser { diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoParser.java b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoParser.java index 81a49043..35b30336 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoParser.java +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoParser.java @@ -33,7 +33,7 @@ /**请求解析器 - * 具体见 https://github.com/Tencent/APIJSON/issues/38 + * 具体见 https://github.com/APIJSON/APIJSON/issues/38 * @author Lemon */ public class DemoParser extends APIJSONParser { diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLConfig.java b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLConfig.java index 1ba6de56..2b78df50 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLConfig.java +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLConfig.java @@ -37,7 +37,7 @@ /**SQL配置 * TiDB 用法和 MySQL 一致 * 具体见详细的说明文档 C.开发说明 C-1-1.修改数据库链接 - * 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 + * https://github.com/APIJSON/APIJSON/blob/main/%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 * @author Lemon */ public class DemoSQLConfig extends APIJSONSQLConfig { diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java index 3fcd7658..04ffe359 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoSQLExecutor.java @@ -52,7 +52,7 @@ /** * SQL 执行器,支持连接池及多数据源 - * 具体见 https://github.com/Tencent/APIJSON/issues/151 + * 具体见 https://github.com/APIJSON/APIJSON/issues/151 * * @author Lemon */ diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoVerifier.java b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoVerifier.java index 60d3fbff..bfe4a0fc 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoVerifier.java +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/demo/DemoVerifier.java @@ -20,7 +20,7 @@ /**安全校验器,校验请求参数、角色与权限等 - * 具体见 https://github.com/Tencent/APIJSON/issues/12 + * 具体见 https://github.com/APIJSON/APIJSON/issues/12 * @author Lemon */ public class DemoVerifier extends APIJSONVerifier { diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md index 1eb96416..27e6c9eb 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md @@ -21,7 +21,7 @@ 集合 文档、测试、Mock、调试、管理 的一站式体验,还有 **AI 问答** 和一键 格式化、注释/取消注释 等高效快捷键。
在常用功能上远超 Postman, Swagger, YApi 等各种 开源、商业 的 API 文档/测试 工具,并能一键导入用例和文档。
支持 GET, POST, PUT, PATCH, DELETE, HEAD 等各种 HTTP Method 及 Content-Type, URL /{Path}/{Variable}。
-不仅适用于 RESTful、类 RESTful、GRPC 的 API,还是腾讯 [APIJSON](https://github.com/Tencent/APIJSON) 官方建议的文档与测试工具。
+不仅适用于 RESTful、类 RESTful、GRPC 的 API,还是腾讯 [APIJSON](https://github.com/APIJSON/APIJSON) 官方建议的文档与测试工具。
腾讯内部用户包括 IEG 互动娱乐事业群、TEG 技术工程事业群、CSIG 云与智慧事业群 的多个部门及团队,
外部用户包含 华为、工商银行某地分行、500 强上市公司传音、跨境电商巨头 SHEIN、行业领头羊社保科技 等。 @@ -248,7 +248,7 @@ https://github.com/TommyLemon/APIAuto/issues/9 #### 2.没有生成文档 右上角设置项与数据库实际配置不一致 等
-https://github.com/Tencent/APIJSON/issues/85 +https://github.com/APIJSON/APIJSON/issues/85 #### 3.托管服务器访问不了 不能代理接口、不能展示文档、不能对断言结果纠错 等
@@ -295,13 +295,13 @@ https://github.com/TommyLemon/APIAuto/issues ![image](https://github.com/user-attachments/assets/c4aa8573-f8b3-4973-8c37-29677c06ac3b) 如果有什么问题或建议可以 [提 issue](https://github.com/TommyLemon/APIAuto/issues),交流技术,分享经验。
-如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md),感激不尽。 +如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/APIJSON/APIJSON/blob/main/CONTRIBUTING.md),感激不尽。

### 生态项目 -[APIJSON](https://github.com/Tencent/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 +[APIJSON](https://github.com/APIJSON/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 [CVAuto](https://github.com/TommyLemon/CVAuto) 👁 零代码零标注 CV AI 自动化测试平台 🚀 免除大量人工画框和打标签等,直接快速测试 CV 计算机视觉 AI 图像识别算法 diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js index 2abab0c2..799d1acd 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js @@ -185,6 +185,10 @@ var JSONResponse = { KEY_MSG: 'msg', KEY_THROW: 'throw', CODE_SUCCESS: 200, + IGNORE_KEYS: ['traceId', 'trace:stack', 'debug:info|help'], + UPGRADE_KEYS: ['price', 'amount', 'money', 'cash', 'spend', 'cost', 'income', 'outgoing', 'borrow', 'lend', 'gold', 'coin', 'diamond', 'credit', 'budget', 'quantity', 'balance'], + DOWNGRADE_KEYS: ['id', 'ID', 'traceId', 'trace_id', 'date', 'time', 'datetime', 'date_time', 'dateTime', 'timestamp', 'create_time', 'update_time', 'created_at', 'updated_at', 'createTime', 'updateTime', 'createdAt', 'updatedAt'], + /**是否成功 * @param code * @return @@ -917,7 +921,9 @@ var JSONResponse = { }; } - if (notEmpty == true && typeof real != 'boolean' && typeof real != 'number' && StringUtil.isEmpty(real, true)) { // 空 + var realType = JSONResponse.getType(real); + + if (notEmpty == true && (real === 0 || (typeof real != 'boolean' && CodeUtil.isTypeMatch('number', realType) && StringUtil.isEmpty(real, true)))) { // 空 log('compareWithStandard notEmpty == true && StringUtil.isEmpty(real, true) >> return COMPARE_VALUE_EMPTY'); return { code: JSONResponse.COMPARE_VALUE_EMPTY, @@ -934,7 +940,6 @@ var JSONResponse = { value: null //导致正确时也显示 real }; - var realType = JSONResponse.getType(real); if (StringUtil.isEmpty(realType) || ['null', 'undefined'].indexOf(realType) >= 0) { realType = null; } @@ -1067,13 +1072,31 @@ var JSONResponse = { var valueCompare = max.code >= JSONResponse.COMPARE_VALUE_CHANGE ? 0 : JSONResponse.compareValue(valueLevel, values, real, target.trend, target.repeat); + var isNum = CodeUtil.isTypeMatch('number', type) + + if (isNum) { + if (JSONResponse.UPGRADE_KEYS.includes(folder)) { + valueCompare++; + } else if (JSONResponse.DOWNGRADE_KEYS.includes(folder)) { + valueCompare--; + } else if (folder.includes('/')) { + var keys = StringUtil.splitPath(folder); + var key = keys == null || keys.length <= 0 ? null : keys[keys.length - 1]; + if (StringUtil.isNotEmpty(key) && !StringUtil.isNumber(key)) { + if (JSONResponse.UPGRADE_KEYS.includes(key)) { + valueCompare++; + } else if (JSONResponse.DOWNGRADE_KEYS.includes(key)) { + valueCompare--; + } + } + } + } + if (valueCompare > 0) { max.code = valueCompare; max.path = folder; max.value = real; - var isNum = CodeUtil.isTypeMatch('number', type) - if (isNum && valueCompare == JSONResponse.COMPARE_VALUE_REPEAT && (target.repeat == null || target.repeat <= 0) && values != null && values.indexOf(real) >= 0) { max.msg = '值与历史值重复:' + real; @@ -1377,8 +1400,14 @@ var JSONResponse = { var notEmpty = target.notEmpty; log('updateStandard notEmpty = target.notEmpty = ' + notEmpty + ' >>'); - if (notEmpty !== false && real != null && typeof real != 'boolean' && typeof real != 'number') { - notEmpty = target.notEmpty = StringUtil.isNotEmpty(real, true); + var rtype = JSONResponse.getType(real); + + if (notEmpty !== false) { + if (CodeUtil.isTypeMatch('number', rtype)) { // real === 0) { + notEmpty = target.notEmpty = real === 0 ? false : (real < -1 || real > 1 ? true : notEmpty); + } else if (real != null && typeof real != 'boolean') { + notEmpty = target.notEmpty = StringUtil.isNotEmpty(real, true); + } } var type = target.type; @@ -1386,7 +1415,6 @@ var JSONResponse = { target.type = type = null; } - var rtype = JSONResponse.getType(real); if ((rtype == null || real == null) && StringUtil.isEmpty(type, true) && StringUtil.isNotEmpty(key, true)) { target.guess = true; if (StringUtil.isBoolKey(key)) { @@ -1490,7 +1518,6 @@ var JSONResponse = { } log('updateStandard type = target.type = getType(real) = ' + type + ' >>'); - var lengthLevel = target.lengthLevel; var lengths = target.lengths; log('updateStandard lengthLevel = target.lengthLevel = ' + lengthLevel + ' >>'); @@ -1629,16 +1656,18 @@ var JSONResponse = { } } - if (values == null) { - values = []; - } - if (valueLevel < 1 && type == 'number' && ! Number.isSafeInteger(real)) { //double 1.23 - valueLevel = 1; - } - target.values = values; + if (! [null, 0, ''].includes(real)) { + if (values == null) { + values = []; + } + if (valueLevel < 1 && CodeUtil.isTypeMatch('number', type) && ! Number.isSafeInteger(real)) { //double 1.23 + valueLevel = 1; + } + target.values = values; - target = JSONResponse.setValue(target, JSONResponse.getLength(real), lengthLevel == null ? 1 : lengthLevel, lengths, true, true); - target = JSONResponse.setValue(target, real, valueLevel, values, false, ignoreTrend); + target = JSONResponse.setValue(target, JSONResponse.getLength(real), lengthLevel == null ? 1 : lengthLevel, lengths, true, true); + target = JSONResponse.setValue(target, real, valueLevel, values, false, ignoreTrend); + } } log('\nupdateStandard >> return target = ' + JSON.stringify(target, null, ' ') + '\n >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> \n\n\n\n\n'); diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html index 6288b889..669bb858 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html @@ -89,20 +89,19 @@ 2s - - +
- - - + + + diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js index c887ed0d..473a761e 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js @@ -733,7 +733,7 @@ https://github.com/TommyLemon/APIAuto/issues 如果是请求 APIJSON 后端服务,则使用以下链接: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues There may be something wrong, you can follow by the steps: 1. Check whether the network connection is available, you can open the address with a browser: https://www.google.com/search?q=%22APIJSON%22 @@ -749,7 +749,7 @@ There may be something wrong, you can follow by the steps: https://github.com/TommyLemon/APIAuto/issues If you are requesting an APIJSON backend service, use the following link: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues @@ -3227,7 +3227,7 @@ https://github.com/Tencent/APIJSON/issues if (this.isExportRemote == false) { //下载到本地 if (this.isTestCaseShow) { //文档 - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\nBASE_URL: ' + this.getBaseUrl() + '\n\n\n## 测试用例(Markdown格式,可用工具预览) \n\n' + this.getDoc4TestCase() + (this.view != 'markdown' ? '' : '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc) @@ -3332,7 +3332,7 @@ https://github.com/Tencent/APIJSON/issues break; } - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\n\nURL: ' + StringUtil.get(vUrl.value) + '\n\n\nHeader:\n' + StringUtil.get(vHeader.value) + '\n\n\nRequest:\n' + StringUtil.get(vInput.value) @@ -9431,16 +9431,20 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea s += '\n\n#### 开放源码 ' + '\nAPIJSON 接口测试: https://github.com/TommyLemon/APIAuto ' + '\nAPIJSON 单元测试: https://github.com/TommyLemon/UnitAuto ' - + '\nAPIJSON 中文文档: https://github.com/vincentCheng/apijson-doc ' - + '\nAPIJSON 英文文档: https://github.com/ruoranw/APIJSONdocs ' + + '\nAPIJSON DB 测试: https://github.com/TommyLemon/SQLAuto ' + + '\nAPIJSON UI 测试: https://github.com/TommyLemon/AutoUI ' + + '\nAPIJSON CV 测试: https://github.com/TommyLemon/CVAuto ' + + '\nAPIJSON AI 测试: https://github.com/open-doubao-ai/OpenDoubao ' + '\nAPIJSON 官方网站: https://github.com/APIJSON/apijson.cn ' - + '\nAPIJSON -Java版: https://github.com/Tencent/APIJSON ' + + '\nAPIJSON 英语文档: https://github.com/ruoranw/APIJSONdocs ' + + '\nAPIJSON -Java版: https://github.com/APIJSON/APIJSON ' + '\nAPIJSON - C# 版: https://github.com/liaozb/APIJSON.NET ' + '\nAPIJSON - Go 版: https://github.com/glennliao/apijson-go ' + '\nAPIJSON - PHP版: https://github.com/kvnZero/hyperf-APIJSON ' + '\nAPIJSON -Node版: https://github.com/kevinaskin/apijson-node ' + + '\nAPIJSON -Rust版: https://github.com/APIJSON/apijson-rust ' + '\nAPIJSON -Python: https://github.com/zhangchunlin/uliweb-apijson ' - + '\n感谢热心的作者们的贡献,GitHub 右上角点 ⭐Star 支持下他们吧 ^_^'; + + '\n感谢热心的作者们的贡献,GitHub 右上角点亮 ⭐ Star 收藏/支持下他们吧 ^_^'; } return s; @@ -9472,11 +9476,11 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea + (this.isTestCaseShow ? '' : output) + ( '\n\n\n登录后点 ↑ 上方左侧最后图标按钮显示用例详情,- 移除、↑ 点 Tab 登录(红色)/退出(黑色)测试账号、+ 添加' + '\n点左上角 测试用例 可切换 远程在线 \| 场景串联 \| 本地历史,点它们右侧 (10\|50) 切换显示 分组 \| 用例' - + '\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/Tencent/APIJSON/blob/master/Document.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + + '\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/APIJSON/APIJSON/blob/main/Document.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + '

关于

' + '

APIAuto-机器学习 HTTP 接口工具' + '
机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释' - + '
由
APIAuto(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + + '
由 APIAuto(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + '
遵循 Apache-2.0 开源协议' + '
Copyright © 2017-' + new Date().getFullYear() + ' Tommy Lemon' + '
粤ICP备18005508号-1' @@ -13218,7 +13222,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea var testRecord = item.TestRecord = item.TestRecord || {} saveTextAs( - '# APIJSON自动化回归测试-前\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-前\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(parseJSON(testRecord.response || '{}'), null, ' ') , '测试:' + document.name + '-前.txt' @@ -13235,7 +13239,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea var accountIdStr = String(curAccount.isLoggedIn ? curAccount.id || '' : '') var tests = App.tests[accountIdStr] || {} saveTextAs( - '# APIJSON自动化回归测试-后\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-后\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(tests[document.id][isRandom ? random.id : 0] || {}, null, ' ') , '测试:' + document.name + '-后.txt' @@ -13245,7 +13249,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea if (StringUtil.isEmpty(testRecord.standard, true) == false) { setTimeout(function () { saveTextAs( - '# APIJSON自动化回归测试-标准\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-标准\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n测试结果: \n' + JSON.stringify(testRecord.compare || '{}', null, ' ') + '\n测试标准: \n' + JSON.stringify(parseJSON(testRecord.standard || '{}'), null, ' ') diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/README.md b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/README.md index 6e21476d..091ae769 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/README.md +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/README.md @@ -192,7 +192,7 @@ https://github.com/TommyLemon/APIAuto/issues/9 #### 2.没有生成文档 右上角设置项与数据库实际配置不一致 等
-https://github.com/Tencent/APIJSON/issues/85 +https://github.com/APIJSON/APIJSON/issues/85 #### 3.托管服务器访问不了 不能代理接口、不能展示文档、不能对断言结果纠错 等
@@ -218,13 +218,13 @@ https://github.com/TommyLemon/APIAuto/issues ![TommyLemon-GItHub](https://github.com/user-attachments/assets/4c2d9e75-01f7-4072-bed3-cfbd10076512) 如果有什么问题或建议可以 [去 APIAuto 提 issue](https://github.com/TommyLemon/APIAuto/issues),交流技术,分享经验。
-如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md),感激不尽。 +如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/APIJSON/APIJSON/blob/main/CONTRIBUTING.md),感激不尽。

### 生态项目 -[APIJSON](https://github.com/Tencent/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 +[APIJSON](https://github.com/APIJSON/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 [APIAuto](https://github.com/TommyLemon/APIAuto) ☔ 敏捷开发最强大易用的接口工具,零代码测试与 AI 问答、生成代码与静态检查、生成文档与光标悬浮注释,腾讯、华为、SHEIN、传音、工行等使用 diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/index.html index f4c3fca5..0de0a9af 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/index.html @@ -101,9 +101,9 @@

- - - + + + diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/js/main.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/js/main.js index ba017ed6..a57f9835 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/js/main.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/js/main.js @@ -667,7 +667,7 @@ https://github.com/TommyLemon/APIAuto/issues 如果是请求 APIJSON 后端服务,则使用以下链接: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues There may be something wrong, you can follow by the steps: 1. Check whether the network connection is available, you can open the address with a browser: https://www.google.com/search?q=%22APIJSON%22 @@ -683,7 +683,7 @@ There may be something wrong, you can follow by the steps: https://github.com/TommyLemon/APIAuto/issues If you are requesting an APIJSON backend service, use the following link: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues @@ -2969,7 +2969,7 @@ https://github.com/Tencent/APIJSON/issues if (this.isExportRemote == false) { //下载到本地 if (this.isTestCaseShow) { //文档 - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\nBASE_URL: ' + this.getBaseUrl() + '\n\n\n## 测试用例(Markdown格式,可用工具预览) \n\n' + this.getDoc4TestCase() + '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc @@ -3014,7 +3014,7 @@ https://github.com/Tencent/APIJSON/issues break; } - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\n\nURL: ' + StringUtil.get(vUrl.value) + '\n\n\nHeader:\n' + StringUtil.get(vHeader.value) + '\n\n\nRequest:\n' + StringUtil.get(vInput.value) @@ -10190,7 +10190,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea + '\nAPIJSON 中文文档: https://github.com/vincentCheng/apijson-doc ' + '\nAPIJSON 英文文档: https://github.com/ruoranw/APIJSONdocs ' + '\nAPIJSON 官方网站: https://github.com/APIJSON/apijson.cn ' - + '\nAPIJSON -Java版: https://github.com/Tencent/APIJSON ' + + '\nAPIJSON -Java版: https://github.com/APIJSON/APIJSON ' + '\nAPIJSON - C# 版: https://github.com/liaozb/APIJSON.NET ' + '\nAPIJSON - Go 版: https://github.com/glennliao/apijson-go ' + '\nAPIJSON - PHP版: https://github.com/kvnZero/hyperf-APIJSON ' @@ -10226,11 +10226,11 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea } vOutput.value = (StringUtil.isEmpty(url, true) ? (StringUtil.isEmpty(html, true) ? '' : StringUtil.trim(html) + '
') : '
') + (this.isTestCaseShow ? '' : output) + ( - '\n\n\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/Tencent/APIJSON/blob/master/Flow.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + '\n\n\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/APIJSON/APIJSON/blob/main/Flow.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + '

关于

' + '

AutoUI - 📱 零代码快准稳 UI 智能录制回放平台' + '
🚀 自动兼容任意宽高比分辨率屏幕,自动精准等待网络请求,录制回放快、准、稳!' - + '
由
AutoUI(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + + '
由 AutoUI(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + '
遵循 Apache-2.0 开源协议' + '
Copyright © 2019-' + new Date().getFullYear() + ' Tommy Lemon' + '
粤ICP备18005508号-1' @@ -13026,7 +13026,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea var testRecord = item.TestRecord = item.TestRecord || {} saveTextAs( - '# APIJSON自动化回归测试-前\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-前\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(parseJSON(testRecord.response || '{}'), null, ' ') , '测试:' + document.name + '-前.txt' @@ -13041,7 +13041,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea setTimeout(function () { var tests = App.tests[String(App.currentAccountIndex)] || {} saveTextAs( - '# APIJSON自动化回归测试-后\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-后\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(tests[document.id][isRandom ? random.id : 0] || {}, null, ' ') , '测试:' + document.name + '-后.txt' @@ -13051,7 +13051,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea if (StringUtil.isEmpty(testRecord.standard, true) == false) { setTimeout(function () { saveTextAs( - '# APIJSON自动化回归测试-标准\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-标准\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n测试结果: \n' + JSON.stringify(testRecord.compare || '{}', null, ' ') + '\n测试标准: \n' + JSON.stringify(parseJSON(testRecord.standard || '{}'), null, ' ') diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/README.md b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/README.md index 7539f3fc..f237d237 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/README.md +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/README.md @@ -182,7 +182,7 @@ https://github.com/TommyLemon/APIAuto/issues/9 #### 2.没有生成文档 右上角设置项与数据库实际配置不一致 等
-https://github.com/Tencent/APIJSON/issues/85 +https://github.com/APIJSON/APIJSON/issues/85 #### 3.托管服务器访问不了 不能代理接口、不能展示文档、不能对断言结果纠错 等
@@ -208,13 +208,13 @@ https://github.com/TommyLemon/APIAuto/issues ![TommyLemon-GItHub](https://github.com/user-attachments/assets/4c2d9e75-01f7-4072-bed3-cfbd10076512) 如果有什么问题或建议可以 [去 APIAuto 提 issue](https://github.com/TommyLemon/APIAuto/issues),交流技术,分享经验。
-如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md),感激不尽。 +如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/APIJSON/APIJSON/blob/main/CONTRIBUTING.md),感激不尽。

### 生态项目 -[APIJSON](https://github.com/Tencent/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 +[APIJSON](https://github.com/APIJSON/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 [APIAuto](https://github.com/TommyLemon/APIAuto) ☔ 敏捷开发最强大易用的接口工具,零代码测试与 AI 问答、生成代码与静态检查、生成文档与光标悬浮注释,腾讯、华为、SHEIN、传音、工行等使用 diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/index.html index db29fc76..aa6e9430 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/index.html @@ -101,9 +101,9 @@

- - - + + + diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/js/main.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/js/main.js index 209c08dc..55825c81 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/js/main.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/cv/js/main.js @@ -661,7 +661,7 @@ https://github.com/TommyLemon/APIAuto/issues 如果是请求 APIJSON 后端服务,则使用以下链接: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues There may be something wrong, you can follow by the steps: 1. Check whether the network connection is available, you can open the address with a browser: https://www.google.com/search?q=%22APIJSON%22 @@ -677,7 +677,7 @@ There may be something wrong, you can follow by the steps: https://github.com/TommyLemon/APIAuto/issues If you are requesting an APIJSON backend service, use the following link: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues `; @@ -2941,7 +2941,7 @@ https://github.com/Tencent/APIJSON/issues if (this.isExportRemote == false) { //下载到本地 if (this.isTestCaseShow) { //文档 - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\nBASE_URL: ' + this.getBaseUrl() + '\n\n\n## 测试用例(Markdown格式,可用工具预览) \n\n' + this.getDoc4TestCase() + '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc @@ -3050,7 +3050,7 @@ https://github.com/Tencent/APIJSON/issues break; } - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\n\nURL: ' + StringUtil.get(vUrl.value) + '\n\n\nHeader:\n' + StringUtil.get(vHeader.value) + '\n\n\nRequest:\n' + StringUtil.get(vInput.value) @@ -9392,7 +9392,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea + '\nAPIJSON 中文文档: https://github.com/vincentCheng/apijson-doc ' + '\nAPIJSON 英文文档: https://github.com/ruoranw/APIJSONdocs ' + '\nAPIJSON 官方网站: https://github.com/APIJSON/apijson.cn ' - + '\nAPIJSON -Java版: https://github.com/Tencent/APIJSON ' + + '\nAPIJSON -Java版: https://github.com/APIJSON/APIJSON ' + '\nAPIJSON - C# 版: https://github.com/liaozb/APIJSON.NET ' + '\nAPIJSON - Go 版: https://github.com/glennliao/apijson-go ' + '\nAPIJSON - PHP版: https://github.com/kvnZero/hyperf-APIJSON ' @@ -9428,11 +9428,11 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea } vOutput.value = (StringUtil.isEmpty(url, true) ? (StringUtil.isEmpty(html, true) ? '' : StringUtil.trim(html) + '
') : '
') + (this.isTestCaseShow ? '' : output) + ( - '\n\n\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/Tencent/APIJSON/blob/master/Document.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + '\n\n\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/APIJSON/APIJSON/blob/main/Document.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + '

关于

' + '

APIAuto-机器学习 HTTP 接口工具' + '
机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释' - + '
由
APIAuto(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + + '
由 APIAuto(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + '
遵循 Apache-2.0 开源协议' + '
Copyright © 2017-' + new Date().getFullYear() + ' Tommy Lemon' + '
粤ICP备18005508号-1' @@ -12731,7 +12731,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea var testRecord = item.TestRecord = item.TestRecord || {} saveTextAs( - '# APIJSON自动化回归测试-前\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-前\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(parseJSON(testRecord.response || '{}'), null, ' ') , '测试:' + document.name + '-前.txt' @@ -12746,7 +12746,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea setTimeout(function () { var tests = App.tests[String(App.currentAccountIndex)] || {} saveTextAs( - '# APIJSON自动化回归测试-后\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-后\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(tests[document.id][isRandom ? random.id : 0] || {}, null, ' ') , '测试:' + document.name + '-后.txt' @@ -12756,7 +12756,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea if (StringUtil.isEmpty(testRecord.standard, true) == false) { setTimeout(function () { saveTextAs( - '# APIJSON自动化回归测试-标准\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-标准\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n测试结果: \n' + JSON.stringify(testRecord.compare || '{}', null, ' ') + '\n测试标准: \n' + JSON.stringify(parseJSON(testRecord.standard || '{}'), null, ' ') diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/index.html index 2f9c740c..d629f4a2 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/index.html @@ -1,12 +1,12 @@ - 腾讯 APIJSON.cn-零代码接口和文档 JSON 协议 与 ORM 库 + APIJSON.cn-零代码接口和文档 JSON 协议 与 ORM 库 -

腾讯 APIJSON.cn - 零代码接口和文档 JSON 协议 与 ORM 库
+
腾讯 APIJSON.cn - 零代码接口和文档 JSON 协议 与 ORM 库

接口 APIAuto 测试(5s 后自动跳转): https://github.com/TommyLemon/APIAuto

单元 UnitAuto 测试: https://github.com/TommyLemon/UnitAuto

diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/README.md b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/README.md index 1ec4f95e..17d0a22a 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/README.md +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/README.md @@ -127,7 +127,7 @@ https://github.com/TommyLemon/APIAuto/issues/9 #### 2.没有生成文档 右上角设置项与数据库实际配置不一致 等
-https://github.com/Tencent/APIJSON/issues/85 +https://github.com/APIJSON/APIJSON/issues/85 #### 3.托管服务器访问不了 不能代理接口、不能展示文档、不能对断言结果纠错 等
@@ -153,13 +153,13 @@ https://github.com/TommyLemon/APIAuto/issues 如果有什么问题或建议可以 [去 APIAuto 提 issue](https://github.com/TommyLemon/APIAuto/issues),交流技术,分享经验。
-如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md),感激不尽。 +如果你解决了某些 bug,或者新增了一些功能,欢迎 [提 PR 贡献代码](https://github.com/APIJSON/APIJSON/blob/main/CONTRIBUTING.md),感激不尽。

### 生态项目 -[APIJSON](https://github.com/Tencent/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 +[APIJSON](https://github.com/APIJSON/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 [APIAuto](https://github.com/TommyLemon/APIAuto) 敏捷开发最强大易用的 HTTP 接口工具,机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释,集 文档、测试、Mock、调试、管理 于一体的一站式体验 diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/index.html index 519bce6e..59669938 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/index.html @@ -78,15 +78,15 @@
- - - + + + diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/js/main.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/js/main.js index 2485cc7e..33a1e7ae 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/js/main.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/sql/js/main.js @@ -478,7 +478,7 @@ https://github.com/TommyLemon/APIAuto/issues 如果是请求 APIJSON 后端服务,则使用以下链接: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues There may be something wrong, you can follow by the steps: 1. Check whether the network connection is available, you can open the address with a browser: https://www.google.com/search?q=%22APIJSON%22 @@ -494,7 +494,7 @@ There may be something wrong, you can follow by the steps: https://github.com/TommyLemon/APIAuto/issues If you are requesting an APIJSON backend service, use the following link: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues `; @@ -2045,7 +2045,7 @@ https://github.com/Tencent/APIJSON/issues if (this.isExportRemote == false) { //下载到本地 if (this.isTestCaseShow) { //文档 - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\nBASE_URL: ' + this.getBaseUrl() + '\n\n\n## 测试用例(Markdown格式,可用工具预览) \n\n' + this.getDoc4TestCase() + (this.view != 'markdown' ? '' : '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc) @@ -2146,7 +2146,7 @@ https://github.com/Tencent/APIJSON/issues break; } - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\n\nURL: ' + StringUtil.get(vUrl.value) + '\n\n\nHeader:\n' + StringUtil.get(vHeader.value) + '\n\n\nRequest:\n' + StringUtil.get(vInput.value) @@ -5995,7 +5995,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea + '\nAPIJSON 中文文档: https://github.com/vincentCheng/apijson-doc ' + '\nAPIJSON 英文文档: https://github.com/ruoranw/APIJSONdocs ' + '\nAPIJSON 官方网站: https://github.com/APIJSON/apijson.cn ' - + '\nAPIJSON -Java版: https://github.com/Tencent/APIJSON ' + + '\nAPIJSON -Java版: https://github.com/APIJSON/APIJSON ' + '\nAPIJSON - C# 版: https://github.com/liaozb/APIJSON.NET ' + '\nAPIJSON - Go 版: https://github.com/glennliao/apijson-go ' + '\nAPIJSON - PHP版: https://github.com/kvnZero/hyperf-APIJSON ' @@ -6017,11 +6017,11 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea } doc = d; vOutput.value = (this.isTestCaseShow ? '' : output) + ( - '\n\n\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/Tencent/APIJSON/blob/master/Document.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + '\n\n\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/APIJSON/APIJSON/blob/main/Document.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d + '

关于

' + '

SQLAuto-智能零代码数据库测试工具' + '
机器学习零代码测试、任意模板变量增删改查、一键批量生成测试数据' - + '
由
SQLAuto(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + + '
由 SQLAuto(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + '
遵循 Apache-2.0 开源协议' + '
Copyright © 2022-' + new Date().getFullYear() + ' Tommy Lemon' + '
粤ICP备18005508号-1' @@ -8699,7 +8699,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea var testRecord = item.TestRecord = item.TestRecord || {} saveTextAs( - '# APIJSON自动化回归测试-前\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-前\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(parseJSON(testRecord.response || '{}'), null, ' ') , '测试:' + document.name + '-前.txt' @@ -8714,7 +8714,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea setTimeout(function () { var tests = App.tests[String(App.currentAccountIndex)] || {} saveTextAs( - '# APIJSON自动化回归测试-后\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-后\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n返回结果: \n' + JSON.stringify(tests[document.id][isRandom ? random.id : 0] || {}, null, ' ') , '测试:' + document.name + '-后.txt' @@ -8724,7 +8724,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea if (StringUtil.isEmpty(testRecord.standard, true) == false) { setTimeout(function () { saveTextAs( - '# APIJSON自动化回归测试-标准\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-标准\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + (document.version > 0 ? 'V' + document.version : 'V*') + ' ' + document.name + '\n测试结果: \n' + JSON.stringify(testRecord.compare || '{}', null, ' ') + '\n测试标准: \n' + JSON.stringify(parseJSON(testRecord.standard || '{}'), null, ' ') diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/index.html index 7f804499..4a9f7085 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/index.html @@ -76,15 +76,15 @@

- - - + + + diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/js/main.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/js/main.js index 93405367..6bb03dd0 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/js/main.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/ui/js/main.js @@ -1298,7 +1298,7 @@ if (App.isExportRemote == false) { //下载到本地 if (App.isTestCaseShow) { //文档 - saveTextAs('# ' + App.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + App.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\nBASE_URL: ' + this.getBaseUrl() + '\n\n\n## 测试用例(Markdown格式,可用工具预览) \n\n' + App.getDoc4TestCase() + '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc @@ -1399,7 +1399,7 @@ break; } - saveTextAs('# ' + App.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + App.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\n\nURL: ' + StringUtil.get(vUrl.value) + '\n\n\nHeader:\n' + StringUtil.get(vHeader.value) + '\n\n\nRequest:\n' + StringUtil.get(vInput.value) @@ -2893,7 +2893,7 @@ + '\nAPIJSON 官方文档: https://github.com/vincentCheng/apijson-doc ' + '\nAPIJSON 英文文档: https://github.com/ruoranw/APIJSONdocs ' + '\nAPIJSON 官方网站: https://github.com/APIJSON/apijson.org ' - + '\nAPIJSON -Java版: https://github.com/Tencent/APIJSON ' + + '\nAPIJSON -Java版: https://github.com/APIJSON/APIJSON ' + '\nAPIJSON - Go 版: https://github.com/glennliao/apijson-go ' + '\nAPIJSON - C# 版: https://github.com/liaozb/APIJSON.NET ' + '\nAPIJSON - PHP版: https://github.com/xianglong111/APIJSON-php ' @@ -2919,7 +2919,7 @@ + '

关于

' + '

UIGO - 📱 零代码快准稳 UI 智能录制回放平台' + '
🚀 自动兼容任意宽高比分辨率屏幕,自动精准等待网络请求,录制回放快、准、稳!' - + '
由
UIGO(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + + '
由 UIGO(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + '
遵循 Apache-2.0 开源协议' + '
Copyright © 2019-' + new Date().getFullYear() + ' Tommy Lemon' + '
粤ICP备18005508号-1' @@ -4396,7 +4396,7 @@ var testRecord = item.Output = item.Output || {} saveTextAs( - '# APIJSON自动化回归测试-前\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-前\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + document.name + '\n返回结果: \n' + JSON.stringify(parseJSON(testRecord.response || '{}'), null, ' ') , '测试:' + document.name + '-前.txt' @@ -4411,7 +4411,7 @@ setTimeout(function () { var tests = App.tests[String(App.currentAccountIndex)] || {} saveTextAs( - '# APIJSON自动化回归测试-后\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-后\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + document.name + '\n返回结果: \n' + JSON.stringify(tests[document.id][isRandom ? random.id : 0] || {}, null, ' ') , '测试:' + document.name + '-后.txt' @@ -4421,7 +4421,7 @@ if (StringUtil.isEmpty(testRecord.standard, true) == false) { setTimeout(function () { saveTextAs( - '# APIJSON自动化回归测试-标准\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-标准\n主页: https://github.com/APIJSON/APIJSON' + '\n\n接口名称: \n' + document.name + '\n测试结果: \n' + JSON.stringify(testRecord.compare || '{}', null, ' ') + '\n测试标准: \n' + JSON.stringify(parseJSON(testRecord.standard || '{}'), null, ' ') diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/index.html index b3c0fbb1..ead40d71 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/index.html @@ -76,15 +76,15 @@

- - - + + + diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/js/main.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/js/main.js index 8061ab95..87d5381b 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/js/main.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/unit/js/main.js @@ -478,7 +478,7 @@ https://github.com/TommyLemon/APIAuto/issues 如果是请求 APIJSON 后端服务,则使用以下链接: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues There may be something wrong, you can follow by the steps: 1. Check whether the network connection is available, you can open the address with a browser: https://www.google.com/search?q=%22APIJSON%22 @@ -494,7 +494,7 @@ There may be something wrong, you can follow by the steps: https://github.com/TommyLemon/APIAuto/issues If you are requesting an APIJSON backend service, use the following link: -https://github.com/Tencent/APIJSON/issues +https://github.com/APIJSON/APIJSON/issues `; @@ -2252,7 +2252,7 @@ https://github.com/Tencent/APIJSON/issues if (this.isExportRemote == false) { //下载到本地 if (this.isTestCaseShow) { //文档 - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\nBASE_URL: ' + this.getBaseUrl() + '\n\n\n## 测试用例(Markdown格式,可用工具预览) \n\n' + this.getDoc4TestCase() + '\n\n\n\n\n\n\n\n## 文档(Markdown格式,可用工具预览) \n\n' + doc @@ -2357,7 +2357,7 @@ https://github.com/Tencent/APIJSON/issues break; } - saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/Tencent/APIJSON' + saveTextAs('# ' + this.exTxt.name + '\n主页: https://github.com/APIJSON/APIJSON' + '\n\n\nURL: ' + StringUtil.get(vUrl.value) + '\n\n\nHeader:\n' + StringUtil.get(vHeader.value) + '\n\n\nRequest:\n' + StringUtil.get(vInput.value) @@ -6177,7 +6177,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea + '\nAPIJSON 中文文档: https://github.com/vincentCheng/apijson-doc ' + '\nAPIJSON 英文文档: https://github.com/ruoranw/APIJSONdocs ' + '\nAPIJSON 官方网站: https://github.com/APIJSON/apijson.cn ' - + '\nAPIJSON -Java版: https://github.com/Tencent/APIJSON ' + + '\nAPIJSON -Java版: https://github.com/APIJSON/APIJSON ' + '\nAPIJSON - C# 版: https://github.com/liaozb/APIJSON.NET ' + '\nAPIJSON - Go 版: https://github.com/glennliao/apijson-go ' + '\nAPIJSON - PHP版: https://github.com/kvnZero/hyperf-APIJSON ' @@ -6218,7 +6218,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea + '

关于

' + '

UnitAuto-零代码单元测试' + '
机器学习自动化测试、一键导入单元测试用例、自动生成复杂参数组合' - + '
由
UnitAuto-Admin(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + + '
由 UnitAuto-Admin(前端网页工具), APIJSON(后端接口服务) 等提供技术支持' + '
遵循 Apache-2.0 开源协议' + '
Copyright © 2020-' + new Date().getFullYear() + ' Tommy Lemon' + '
粤ICP备18005508号-1' @@ -9276,7 +9276,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea var testRecord = item.TestRecord = item.TestRecord || {} saveTextAs( - '# APIJSON自动化回归测试-前\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-前\n主页: https://github.com/APIJSON/APIJSON' + '\n\n方法名称: \n' + document.method + '\n返回结果: \n' + JSON.stringify(parseJSON(testRecord.response || '{}'), null, ' ') , '测试:' + document.method + '-前.txt' @@ -9291,7 +9291,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea setTimeout(function () { var tests = App.tests[String(App.currentAccountIndex)] || {} saveTextAs( - '# APIJSON自动化回归测试-后\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-后\n主页: https://github.com/APIJSON/APIJSON' + '\n\n方法名称: \n' + document.method + '\n返回结果: \n' + JSON.stringify(tests[document.id][isRandom ? random.id : 0] || {}, null, ' ') , '测试:' + document.method + '-后.txt' @@ -9301,7 +9301,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea if (StringUtil.isEmpty(testRecord.standard, true) == false) { setTimeout(function () { saveTextAs( - '# APIJSON自动化回归测试-标准\n主页: https://github.com/Tencent/APIJSON' + '# APIJSON自动化回归测试-标准\n主页: https://github.com/APIJSON/APIJSON' + '\n\n方法名称: \n' + document.method + '\n测试结果: \n' + JSON.stringify(testRecord.compare || '{}', null, ' ') + '\n测试标准: \n' + JSON.stringify(parseJSON(testRecord.standard || '{}'), null, ' ') From 4702c216ad7cc3acfccd7f1735614e48e20597dc Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Wed, 7 Oct 2026 23:54:15 +0800 Subject: [PATCH 13/26] =?UTF-8?q?Java:=20MultiDataSource=20=E5=86=85=20API?= =?UTF-8?q?Auto=EF=BC=9AJSONResponse=20=E6=96=B0=E5=A2=9E=20IGNORE=5FKEYS?= =?UTF-8?q?=20=E5=BF=BD=E7=95=A5=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/api/apijson/JSONResponse.js | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js index 799d1acd..7ff22cd1 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js @@ -1064,35 +1064,48 @@ var JSONResponse = { max = result; } } catch (e) { - log(e) + log(e); } } } - var valueCompare = max.code >= JSONResponse.COMPARE_VALUE_CHANGE - ? 0 : JSONResponse.compareValue(valueLevel, values, real, target.trend, target.repeat); - - var isNum = CodeUtil.isTypeMatch('number', type) - - if (isNum) { - if (JSONResponse.UPGRADE_KEYS.includes(folder)) { - valueCompare++; - } else if (JSONResponse.DOWNGRADE_KEYS.includes(folder)) { - valueCompare--; + var isNum = CodeUtil.isTypeMatch('number', type); + var ignore = false; + var isFolderMeaningful = StringUtil.isNotEmpty(folder) && ! StringUtil.isNumber(folder); + if (isFolderMeaningful && (isNum || type == 'string')) { + if (JSONResponse.IGNORE_KEYS.includes(folder)) { + ignore = true; } else if (folder.includes('/')) { var keys = StringUtil.splitPath(folder); var key = keys == null || keys.length <= 0 ? null : keys[keys.length - 1]; - if (StringUtil.isNotEmpty(key) && !StringUtil.isNumber(key)) { - if (JSONResponse.UPGRADE_KEYS.includes(key)) { - valueCompare++; - } else if (JSONResponse.DOWNGRADE_KEYS.includes(key)) { - valueCompare--; - } + if (StringUtil.isNotEmpty(key) && ! StringUtil.isNumber(key)) { + ignore = JSONResponse.IGNORE_KEYS.includes(key); } } } + var valueCompare = ignore || max.code >= JSONResponse.COMPARE_VALUE_CHANGE + ? 0 : JSONResponse.compareValue(valueLevel, values, real, target.trend, target.repeat); + if (valueCompare > 0) { + if (isNum && isFolderMeaningful) { + if (JSONResponse.UPGRADE_KEYS.includes(folder)) { + valueCompare ++; + } else if (JSONResponse.DOWNGRADE_KEYS.includes(folder)) { + valueCompare --; + } else if (folder.includes('/')) { + var keys = StringUtil.splitPath(folder); + var key = keys == null || keys.length <= 0 ? null : keys[keys.length - 1]; + if (StringUtil.isNotEmpty(key) && ! StringUtil.isNumber(key)) { + if (JSONResponse.UPGRADE_KEYS.includes(key)) { + valueCompare ++; + } else if (JSONResponse.DOWNGRADE_KEYS.includes(key)) { + valueCompare --; + } + } + } + } + max.code = valueCompare; max.path = folder; max.value = real; From 053442c52642b2a5d7012c2424a5e37d8ef9e727 Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Thu, 8 Oct 2026 00:00:35 +0800 Subject: [PATCH 14/26] =?UTF-8?q?Java:=20MultiDataSource=20=E5=86=85=20API?= =?UTF-8?q?Auto=EF=BC=9AJSONResponse=20=E5=BF=BD=E7=95=A5=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20IGNORE=5FKEYS=20=E5=8E=BB=E6=8E=89=20id=EF=BC=8C?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E5=8F=AA=E6=9C=89=20time=20=E8=BF=99?= =?UTF-8?q?=E7=A7=8D=E7=BA=AF=E5=B1=95=E7=A4=BA=E6=88=96=E6=9F=A5=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E3=80=81=E7=94=9A=E8=87=B3=E4=B8=8D=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=89=8D=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/api/apijson/JSONResponse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js index 7ff22cd1..9c4e03c4 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js @@ -187,7 +187,7 @@ var JSONResponse = { CODE_SUCCESS: 200, IGNORE_KEYS: ['traceId', 'trace:stack', 'debug:info|help'], UPGRADE_KEYS: ['price', 'amount', 'money', 'cash', 'spend', 'cost', 'income', 'outgoing', 'borrow', 'lend', 'gold', 'coin', 'diamond', 'credit', 'budget', 'quantity', 'balance'], - DOWNGRADE_KEYS: ['id', 'ID', 'traceId', 'trace_id', 'date', 'time', 'datetime', 'date_time', 'dateTime', 'timestamp', 'create_time', 'update_time', 'created_at', 'updated_at', 'createTime', 'updateTime', 'createdAt', 'updatedAt'], + DOWNGRADE_KEYS: ['traceId', 'trace_id', 'date', 'time', 'datetime', 'date_time', 'dateTime', 'timestamp', 'create_time', 'update_time', 'created_at', 'updated_at', 'createTime', 'updateTime', 'createdAt', 'updatedAt'], /**是否成功 * @param code From b5162cbe0285b1d9ad1179dc563d324f7da45ace Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Fri, 9 Oct 2026 01:06:37 +0800 Subject: [PATCH 15/26] =?UTF-8?q?Java:=20MultiDataSource=20=E5=86=85=20API?= =?UTF-8?q?Auto=EF=BC=9A=E5=AE=8C=E5=96=84=E6=96=AD=E8=A8=80=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E5=91=BD=E5=90=8D=E5=88=A4=E6=96=AD=E5=92=8C?= =?UTF-8?q?=E5=8D=87=E9=99=8D=E7=BA=A7=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/api/apijson/JSONResponse.js | 74 ++++++++++++++++--- .../static/api/apijson/StringUtil.js | 33 ++++++++- 2 files changed, 93 insertions(+), 14 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js index 9c4e03c4..fa7b0838 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js @@ -186,8 +186,8 @@ var JSONResponse = { KEY_THROW: 'throw', CODE_SUCCESS: 200, IGNORE_KEYS: ['traceId', 'trace:stack', 'debug:info|help'], - UPGRADE_KEYS: ['price', 'amount', 'money', 'cash', 'spend', 'cost', 'income', 'outgoing', 'borrow', 'lend', 'gold', 'coin', 'diamond', 'credit', 'budget', 'quantity', 'balance'], - DOWNGRADE_KEYS: ['traceId', 'trace_id', 'date', 'time', 'datetime', 'date_time', 'dateTime', 'timestamp', 'create_time', 'update_time', 'created_at', 'updated_at', 'createTime', 'updateTime', 'createdAt', 'updatedAt'], + UPGRADE_KEYS: ['price', 'amount', 'money', 'cash', 'spend', 'cost', 'income', 'outgoing', 'borrow', 'lend', 'gold', 'coin', 'diamond', 'credit', 'budget', 'quantity', 'balance', 'type', 'status', 'state', 'stage', 'mode', 'currency', 'percent', 'percentage', 'rate', 'ratio', 'cent', 'vip', 'tax', 'change', 'exchange', 'role', 'permission', 'access', 'wealth', 'fee', 'pay', 'sku', 'spu', 'level', 'reward', 'award', 'bonus', 'consume', 'produce', 'gift', 'order', 'buy', 'purchase', 'salary', 'earn', 'coupon', 'discount'], + DOWNGRADE_KEYS: ['traceId', 'trace_id', 'date', 'time', 'datetime', 'date_time', 'dateTime', 'timestamp', 'create_time', 'update_time', 'created_at', 'updated_at', 'createTime', 'updateTime', 'createdAt', 'updatedAt', 'delete_time', 'deleteTime', 'deleted_at', 'cur_time', 'curTime', 'cur_timestamp', 'curTimestamp', 'cur_time_stamp', 'current_time', 'current_time_stamp', 'currentTime', 'currentTimestamp', 'server_time', 'serverTime', 'start_time', 'started_at', 'startTime', 'startedAt', 'begin_time', 'begun_at', 'beginTime', 'begunAt', 'end_time', 'ended_at', 'endTime', 'endedAt', 'title', 'subtitle', 'content', 'comment', 'emoji', 'name', 'nickname', 'detail', 'desc', 'describe', 'description'], /**是否成功 * @param code @@ -525,6 +525,56 @@ var JSONResponse = { return it; }, + isUpgradeCompare: function (key, folder) { + if (StringUtil.isEmpty(key)) { + return false; + } + + var keys = JSONResponse.UPGRADE_KEYS || []; + if (keys.includes(key) || keys.includes(JSONResponse.getAbstractPath(folder, key))) { + return true; + } + + for (var i = 0; i < keys.length; i ++) { + var k = keys[i]; + if (StringUtil.isNotEmpty(k) && StringUtil.isKeyOfCategory(key, StringUtil.firstCase(k, true))) { + return true; + } + } + + return StringUtil.isMoneyKey(key) || StringUtil.isBalanceKey(key) || StringUtil.isAmountKey(key) || StringUtil.isLoanKey(key) + || StringUtil.isPriceKey(key) || StringUtil.isPercentKey(key) || StringUtil.isRevenueKey(key) || StringUtil.isProfitKey(key) + || StringUtil.isCashKey(key) || StringUtil.isDiscountKey(key) || StringUtil.isGradeKey(key) || StringUtil.isLevelKey(key) + || StringUtil.isRankKey(key) || StringUtil.isScoreKey(key) || StringUtil.isSexKey(key) || StringUtil.isGenderKey(key); + // || StringUtil.isIncomeKey(key) || StringUtil.isOutgoingKey(key) || StringUtil.isGoldKey(key) || StringUtil.isCoinKey(key) + // || StringUtil.isBuyKey(key) || StringUtil.isPurchaseKey(key) || StringUtil.isPayKey(key) || StringUtil.isEarnKey(key) + // || StringUtil.isSalaryKey(key) || StringUtil.isCostKey(key) || StringUtil.isConsumeKey(key) || StringUtil.isProduceKey(key) + // || StringUtil.isFeeKey(key) || StringUtil.isWealthKey(key) || StringUtil.isRewardKey(key) || StringUtil.isAwardKey(key) + // || StringUtil.isVipKey(key) || StringUtil.isDiamondKey(key) || StringUtil.isTaxKey(key) || StringUtil.isCurrencyKey(key) + // || StringUtil.isChangeKey(key) || StringUtil.isExchangeKey(key) || StringUtil.isBorrowKey(key) || StringUtil.isLendKey(key); + }, + isDowngradeCompare: function (key, folder) { + if (StringUtil.isEmpty(key)) { + return false; + } + + var keys = JSONResponse.DOWNGRADE_KEYS || []; + if (keys.includes(key) || keys.includes(JSONResponse.getAbstractPath(folder, key))) { + return true; + } + + for (var i = 0; i < keys.length; i ++) { + var k = keys[i]; + if (StringUtil.isNotEmpty(k) && StringUtil.isKeyOfCategory(key, StringUtil.firstCase(k, true))) { + return true; + } + } + + return StringUtil.isDateKey(key) || StringUtil.isTimeKey(key) || StringUtil.isNameKey(key) || StringUtil.isDetailKey(key) + || StringUtil.isTitleKey(key) || StringUtil.isTextKey(key) || StringUtil.isCommentKey(key) || StringUtil.isContentKey(key) + || StringUtil.isDescribeKey(key) || StringUtil.isMessageKey(key); + }, + /**测试compare: 对比 新的请求与上次请求的结果 0-相同,无颜色; 1-对象新增字段或数组新增值,绿色; @@ -1088,25 +1138,27 @@ var JSONResponse = { ? 0 : JSONResponse.compareValue(valueLevel, values, real, target.trend, target.repeat); if (valueCompare > 0) { - if (isNum && isFolderMeaningful) { + var cmp = valueCompare; + if (isNum && isFolderMeaningful && cmp > JSONResponse.COMPARE_VALUE_MORE && cmp < JSONResponse.COMPARE_VALUE_EMPTY) { if (JSONResponse.UPGRADE_KEYS.includes(folder)) { - valueCompare ++; + cmp = JSONResponse.COMPARE_VALUE_EMPTY; } else if (JSONResponse.DOWNGRADE_KEYS.includes(folder)) { - valueCompare --; + cmp = JSONResponse.COMPARE_VALUE_MORE; } else if (folder.includes('/')) { var keys = StringUtil.splitPath(folder); var key = keys == null || keys.length <= 0 ? null : keys[keys.length - 1]; if (StringUtil.isNotEmpty(key) && ! StringUtil.isNumber(key)) { - if (JSONResponse.UPGRADE_KEYS.includes(key)) { - valueCompare ++; - } else if (JSONResponse.DOWNGRADE_KEYS.includes(key)) { - valueCompare --; + var fd = keys.slice(0, keys.length - 1).join('/'); + if (JSONResponse.isUpgradeCompare(key, fd)) { + cmp = JSONResponse.COMPARE_VALUE_EMPTY; + } else if (JSONResponse.isDowngradeCompare(key, fd)) { + cmp = JSONResponse.COMPARE_VALUE_MORE; } } } } - max.code = valueCompare; + max.code = cmp; max.path = folder; max.value = real; @@ -1536,7 +1588,6 @@ var JSONResponse = { log('updateStandard lengthLevel = target.lengthLevel = ' + lengthLevel + ' >>'); log('updateStandard lengths = target.lengths = ' + lengths + ' >>'); - var valueLevel = target.valueLevel; var values = target.values; log('updateStandard valueLevel = target.valueLevel = ' + valueLevel + ' >>'); @@ -1547,7 +1598,6 @@ var JSONResponse = { valueLevel = target.valueLevel = 0; } - if (type == 'array') { log('updateStandard type == array >> '); diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js index 1d5a40ef..8b35dc2a 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js @@ -727,6 +727,9 @@ var StringUtil = { isScoreKey: function (key) { return StringUtil.isKeyOfCategory(key, 'Score'); }, + isRankKey: function (key) { + return StringUtil.isKeyOfCategory(key, 'Rank'); + }, isSexKey: function (key) { return StringUtil.isKeyOfCategory(key, 'Sex'); }, @@ -773,6 +776,28 @@ var StringUtil = { var l = StringUtil.length(key); return l >= 2 && l <= 30 && StringUtil.isKeyOfCategory(key, 'Name'); }, + isTitleKey: function (key) { + var l = StringUtil.length(key); + return l >= 2 && l <= 30 && StringUtil.isKeyOfCategory(key, 'Title'); + }, + isTextKey: function (key) { + return StringUtil.isKeyOfCategory(key, 'Text') || StringUtil.isKeyOfCategory(key, 'Txt'); + }, + isContentKey: function (key) { + return StringUtil.isKeyOfCategory(key, 'Content'); + }, + isMessageKey: function (key) { + return StringUtil.isKeyOfCategory(key, 'Message') || StringUtil.isKeyOfCategory(key, 'Msg'); + }, + isCommentKey: function (key) { + return StringUtil.isKeyOfCategory(key, 'Comment'); + }, + isDetailKey: function (key) { + return StringUtil.isKeyOfCategory(key, 'Detail'); + }, + isDescribeKey: function (key) { + return StringUtil.isKeyOfCategory(key, 'Desc') || StringUtil.isKeyOfCategory(key, 'Describe') || StringUtil.isKeyOfCategory(key, 'Description'); + }, isPathKey: function (key) { return StringUtil.isKeyOfCategory(key, 'Path'); }, @@ -783,10 +808,14 @@ var StringUtil = { return StringUtil.isKeyOfCategory(key, 'Uri'); }, isDateKey: function (key) { - return ['createat', 'createdat', 'updateat', 'updatedat'].indexOf(StringUtil.get(key).toLowerCase()) >= 0 || StringUtil.isKeyOfCategory(key, 'Date'); + return ['createat', 'createdat', 'updateat', 'updatedat', 'deletdat', 'deletedat', 'addat', 'addedat', 'editat' + , 'editedat', 'removeat', 'removedat', 'sendat', 'sentat', 'sendedat', 'receiveat', 'receivedat'].indexOf(StringUtil.get(key).toLowerCase()) >= 0 + || StringUtil.isKeyOfCategory(key, 'Date'); }, isTimeKey: function (key) { - return ['createat', 'createdat', 'updateat', 'updatedat'].indexOf(StringUtil.get(key).toLowerCase()) >= 0 || StringUtil.isKeyOfCategory(key, 'Time'); + return ['createat', 'createdat', 'updateat', 'updatedat', 'deletdat', 'deletedat', 'addat', 'addedat', 'editat' + , 'editedat', 'removeat', 'removedat', 'sendat', 'sentat', 'sendedat', 'receiveat', 'receivedat'].indexOf(StringUtil.get(key).toLowerCase()) >= 0 + || StringUtil.isKeyOfCategory(key, 'Time') || StringUtil.isKeyOfCategory(key, 'Timestamp'); }, isKeyOfCategory: function (key, category) { if (StringUtil.isEmpty(key, true) || StringUtil.isEmpty(category, true) || key.length < category.length) { From ae3d43d122b9d809640343d969dbeb99f9e93d09 Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Fri, 9 Oct 2026 01:10:14 +0800 Subject: [PATCH 16/26] Update README.md --- .../src/main/resources/static/api/README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md index 27e6c9eb..967d38d5 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/README.md @@ -302,6 +302,7 @@ https://github.com/TommyLemon/APIAuto/issues ### 生态项目 [APIJSON](https://github.com/APIJSON/APIJSON) 🏆 腾讯实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 +[AutoUI](https://github.com/TommyLemon/AutoUI) 📱 AI 零代码快准稳 UI 自动化测试平台 🚀 3 像素内精准定位,2 毫秒内精准等待,自动断言 UI 和数据、界定前/后端 bug,用户包含腾讯,微信团队邀请分享 [CVAuto](https://github.com/TommyLemon/CVAuto) 👁 零代码零标注 CV AI 自动化测试平台 🚀 免除大量人工画框和打标签等,直接快速测试 CV 计算机视觉 AI 图像识别算法 @@ -309,10 +310,6 @@ https://github.com/TommyLemon/APIAuto/issues [SQLAuto](https://github.com/TommyLemon/SQLAuto) 智能零代码自动化测试 SQL 数据库工具,任意增删改查、任意 SQL 模板变量、一键批量生成参数组合、快速构造大量测试数据 -[UIGO](https://github.com/TommyLemon/UIGO) 📱 零代码快准稳 UI 智能录制回放平台 🚀 3 像素内自动精准定位,2 毫秒内自动精准等待,用户包含腾讯,微信团队邀请分享 - -[UIGOX](https://github.com/TommyLemon/UIGOX) UIGO 的 AndroidX 版 📱 零代码快准稳 UI 智能录制回放平台 🚀 3 像素内自动精准定位,2 毫秒内自动精准等待 - [apijson-doc](https://github.com/vincentCheng/apijson-doc) APIJSON 官方文档,提供排版清晰、搜索方便的文档内容展示,包括设计规范、图文教程等 [APIJSONdocs](https://github.com/ruoranw/APIJSONdocs) APIJSON 英文文档,提供排版清晰的文档内容展示,包括详细介绍、设计规范、使用方式等 From eab6d78793aa1c392146197d5da7c36607d00228 Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Fri, 9 Oct 2026 01:26:42 +0800 Subject: [PATCH 17/26] =?UTF-8?q?JSONResponse.UPGRADE=5FKEYS=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20phone,=20email,=20card,=20idcard,=20account=20?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E6=96=AD=E8=A8=80=E8=AD=A6=E5=91=8A=E4=BC=98?= =?UTF-8?q?=E5=85=88=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/api/apijson/JSONResponse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js index fa7b0838..1a217ada 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js @@ -186,7 +186,7 @@ var JSONResponse = { KEY_THROW: 'throw', CODE_SUCCESS: 200, IGNORE_KEYS: ['traceId', 'trace:stack', 'debug:info|help'], - UPGRADE_KEYS: ['price', 'amount', 'money', 'cash', 'spend', 'cost', 'income', 'outgoing', 'borrow', 'lend', 'gold', 'coin', 'diamond', 'credit', 'budget', 'quantity', 'balance', 'type', 'status', 'state', 'stage', 'mode', 'currency', 'percent', 'percentage', 'rate', 'ratio', 'cent', 'vip', 'tax', 'change', 'exchange', 'role', 'permission', 'access', 'wealth', 'fee', 'pay', 'sku', 'spu', 'level', 'reward', 'award', 'bonus', 'consume', 'produce', 'gift', 'order', 'buy', 'purchase', 'salary', 'earn', 'coupon', 'discount'], + UPGRADE_KEYS: ['price', 'amount', 'money', 'cash', 'spend', 'cost', 'income', 'outgoing', 'borrow', 'lend', 'gold', 'coin', 'diamond', 'credit', 'budget', 'quantity', 'balance', 'type', 'status', 'state', 'stage', 'mode', 'currency', 'percent', 'percentage', 'rate', 'ratio', 'cent', 'vip', 'tax', 'change', 'exchange', 'role', 'permission', 'access', 'wealth', 'fee', 'pay', 'sku', 'spu', 'level', 'reward', 'award', 'bonus', 'consume', 'produce', 'gift', 'order', 'buy', 'purchase', 'salary', 'earn', 'coupon', 'discount', 'phone', 'email', 'card', 'idcard', 'account'], DOWNGRADE_KEYS: ['traceId', 'trace_id', 'date', 'time', 'datetime', 'date_time', 'dateTime', 'timestamp', 'create_time', 'update_time', 'created_at', 'updated_at', 'createTime', 'updateTime', 'createdAt', 'updatedAt', 'delete_time', 'deleteTime', 'deleted_at', 'cur_time', 'curTime', 'cur_timestamp', 'curTimestamp', 'cur_time_stamp', 'current_time', 'current_time_stamp', 'currentTime', 'currentTimestamp', 'server_time', 'serverTime', 'start_time', 'started_at', 'startTime', 'startedAt', 'begin_time', 'begun_at', 'beginTime', 'begunAt', 'end_time', 'ended_at', 'endTime', 'endedAt', 'title', 'subtitle', 'content', 'comment', 'emoji', 'name', 'nickname', 'detail', 'desc', 'describe', 'description'], /**是否成功 From 4374c89951a89c61dceed597a89285ba05503595 Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Sun, 18 Oct 2026 23:50:32 +0800 Subject: [PATCH 18/26] =?UTF-8?q?=E9=9B=B6=E4=BB=A3=E7=A0=81=E6=96=AD?= =?UTF-8?q?=E8=A8=80=EF=BC=9A=E6=96=B0=E5=A2=9E=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=96=AD=E8=A8=80=20=E6=90=9C=E7=B4=A2=E3=80=81?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E3=80=81=E6=95=B0=E9=87=8F=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/api/apijson/JSONResponse.js | 167 ++++++++++++++++-- .../static/api/apijson/StringUtil.js | 35 ++++ .../src/main/resources/static/api/js/main.js | 2 + 3 files changed, 189 insertions(+), 15 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js index 1a217ada..b89c0231 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js @@ -467,8 +467,10 @@ var JSONResponse = { COMPARE_KEY_MORE: 1, COMPARE_VALUE_MORE: 2, COMPARE_EQUAL_EXCEPTION: 3, + COMPARE_SORT_CHANGE: 4, // FIXME 不重复,后面都额外加判断? COMPARE_LENGTH_CHANGE: 4, COMPARE_VALUE_CHANGE: 5, + COMPARE_FILTER_CHANGE: 5, // FIXME 不重复,后面都额外加判断? COMPARE_VALUE_EMPTY: 6, COMPARE_KEY_LESS: 7, COMPARE_FORMAT_CHANGE: 8, @@ -907,7 +909,7 @@ var JSONResponse = { 3-缺少字段/整数变小数,黄色; 4-类型/code 改变,红色; */ - compareWithStandard: function(target, real, folder, exceptKeys, ignoreTrend, callback) { + compareWithStandard: function(target, real, folder, exceptKeys, ignoreTrend, preReal, reqSearches, reqSorts, reqLimits, callback) { folder = folder == null ? '' : folder; if (target == null) { @@ -1011,6 +1013,64 @@ var JSONResponse = { max.code -= 1; } + var isStr = type == 'string' + var isNum = (! isStr) && CodeUtil.isTypeMatch('number', type); + preReal = preReal != null ? preReal : (isNum ? 0 : (isStr ? '' : preReal)); + + var keys = StringUtil.splitPath(folder, false); + var key = StringUtil.isEmpty(keys) ? '' : (keys[keys.length - 1] || ''); + + var reqSearchObj = reqSearches == null || max.code >= JSONResponse.COMPARE_FILTER_CHANGE || ! isStr ? null : reqSearches[key]; + var reqSearch = reqSearchObj == null ? null : reqSearchObj.same; + if (StringUtil.isNotEmpty(reqSearch) && ! real.includes(reqSearch)) { + log('compareWithStandard StringUtil.isNotEmpty(reqSearch) && ! real.includes(reqSearch) >> return COMPARE_FILTER_CHANGE'); + max = { + code: JSONResponse.COMPARE_FILTER_CHANGE, + msg: '未包含传参 ' + (StringUtil.isEmpty(reqSearchObj.path) ? '' : reqSearchObj.path + ' 筛选 ') + reqSearch, + path: folder, + value: real + }; + } + + var same = max.code >= JSONResponse.COMPARE_FILTER_CHANGE || ! isStr ? null : target.same; + if (StringUtil.isNotEmpty(same) && ! real.includes(same)) { + log('compareWithStandard StringUtil.isNotEmpty(same) && ! real.includes(same) >> return COMPARE_FILTER_CHANGE'); + max = { + code: JSONResponse.COMPARE_FILTER_CHANGE, + msg: '未包含 ' + same, + path: folder, + value: real + }; + } + + var notCmpSort = reqSorts == null || max.code >= JSONResponse.COMPARE_SORT_CHANGE || ! (isStr || isNum) + var reqSortObj = notCmpSort ? null : reqSorts[key]; + var reqSort = reqSortObj == null ? null : reqSortObj.sort; + + var sort = notCmpSort ? null : target.sort; + if (StringUtil.isNotEmpty(reqSort) || StringUtil.isNotEmpty(sort)) { + var srt = (real === preReal ? '=' : (real > preReal ? '>' : '<')); + + if (! reqSort.includes(srt)) { + log('compareWithStandard StringUtil.isNotEmpty(reqSort) && ! ' + reqSort + '.includes(' + srt + ') >> return COMPARE_SORT_CHANGE'); + max = { + code: JSONResponse.COMPARE_SORT_CHANGE, + msg: '排序 ' + srt + ' 不符合传参 ' + (StringUtil.isEmpty(reqSortObj.path) ? '' : reqSortObj.path + ' ') + reqSort, + path: folder, + value: real + }; + } + + if (max.code < JSONResponse.COMPARE_SORT_CHANGE && ! sort.includes(srt)) { + log('compareWithStandard StringUtil.isNotEmpty(sort) && ! ' + sort + '.includes(' + srt + ') >> return COMPARE_SORT_CHANGE'); + max = { + code: JSONResponse.COMPARE_SORT_CHANGE, + msg: '排序 ' + sort + ' 变成 ' + srt, + path: folder, + value: real + }; + } + } var each; @@ -1020,7 +1080,7 @@ var JSONResponse = { for (var i = 0; i < real.length; i ++) { //检查real的每一项 log('compareWithStandard for i = ' + i + ' >> '); - each = JSONResponse.compareWithStandard(firstVal, real[i], JSONResponse.getAbstractPath(folder, i), exceptKeys, ignoreTrend); + each = JSONResponse.compareWithStandard(firstVal, real[i], JSONResponse.getAbstractPath(folder, i), exceptKeys, ignoreTrend, i <= 0 ? null : real[i - 1], reqSearches, reqSorts, reqLimits); if (max.code < each.code) { max = each; @@ -1055,7 +1115,8 @@ var JSONResponse = { } log('compareWithStandard for tk = ' + tk + ' >> '); - each = JSONResponse.compareWithStandard(firstVal[tk], real[tk], JSONResponse.getAbstractPath(folder, tk), exceptKeys); + each = JSONResponse.compareWithStandard(firstVal[tk], real[tk], JSONResponse.getAbstractPath(folder, tk), exceptKeys + , ignoreTrend, JSONResponse.isObject(preReal) ? preReal[tk] : null, reqSearches, reqSorts, reqLimits); if (max.code < each.code) { max = each; } @@ -1105,7 +1166,14 @@ var JSONResponse = { else if (format instanceof Array == false && format instanceof Object) { try { var realObj = parseJSON(real); - var result = JSONResponse.compareWithStandard(format, realObj, folder, exceptKeys, ignoreTrend); + var preRealObj = null; + try { // FIXME 是否暴露? + preRealObj = parseJSON(preReal); + } catch (e) { + log(e); + } + + var result = JSONResponse.compareWithStandard(format, realObj, folder, exceptKeys, ignoreTrend, preRealObj); // , reqSearches, reqSorts, reqLimits); // TODO: 是否必要在字符串里再解析排序? if (guess == true) { result.code -= 1; } @@ -1119,10 +1187,9 @@ var JSONResponse = { } } - var isNum = CodeUtil.isTypeMatch('number', type); var ignore = false; var isFolderMeaningful = StringUtil.isNotEmpty(folder) && ! StringUtil.isNumber(folder); - if (isFolderMeaningful && (isNum || type == 'string')) { + if (isFolderMeaningful && (isNum || isStr)) { if (JSONResponse.IGNORE_KEYS.includes(folder)) { ignore = true; } else if (folder.includes('/')) { @@ -1201,6 +1268,15 @@ var JSONResponse = { var realLength = JSONResponse.getLength(real); log('compareWithStandard realLength = ' + realLength + ' >> '); + var reqLimitObj = reqLimits == null || type !== 'array' ? null : reqLimits[key]; + var reqLimit = reqLimitObj == null ? null : reqLimitObj.limit; + if (Number.isSafeInteger(reqLimit) && reqLimit > 0 && reqLimit < realLength) { + max.code = JSONResponse.COMPARE_LENGTH_CHANGE; + max.msg = '长度 ' + realLength + ' > 传参限制 ' + reqLimit + ' 个 ' + StringUtil.get(reqLimitObj.path); + max.path = folder; + max.value = realLength; + } + if (realLength != null && JSONResponse.isValueCorrect(target.lengthLevel, target.lengths, realLength) != true) { var lengths = target.lengths var maxVal = lengths == null || lengths.length <= 0 ? null : lengths[0]; @@ -1441,7 +1517,7 @@ var JSONResponse = { /**更新测试标准,通过原来的标准与最新的数据合并来实现 */ - updateStandard: function(target, real, exceptKeys, ignoreTrend, key) { + updateStandard: function(target, real, exceptKeys, ignoreTrend, folder, key, preReal) { if (target instanceof Array) { // JSONArray throw new Error("Standard 语法错误,不应该有 array!"); } @@ -1577,6 +1653,8 @@ var JSONResponse = { return target; } + var fd = JSONResponse.getAbstractPath(folder, key); + log('updateStandard type = target.type = ' + type + ' >>'); if (type == null || CodeUtil.isTypeMatch(target.type, rtype) != true) { //强制用real的类型替代 type = target.type = rtype; @@ -1598,6 +1676,9 @@ var JSONResponse = { valueLevel = target.valueLevel = 0; } + var sort = target.sort; + var same = target.same; + if (type == 'array') { log('updateStandard type == array >> '); @@ -1609,11 +1690,41 @@ var JSONResponse = { } var child = values[0]; - for (var i = 0; i < real.length; i ++) { + var len = real.length; + for (var i = 0; i < len; i ++) { + var v = real[i]; log('updateStandard for i = ' + i + '; child = ' - + JSON.stringify(child, null, ' ') + ';\n real[i] = ' + JSON.stringify(real[i], null, ' ') + ' >>'); + + JSON.stringify(child, null, ' ') + ';\n real[i] = ' + JSON.stringify(v, null, ' ') + ' >>'); + if (i === 0 && len >= 2 && (sort !== '' || same !== '')) { + var isStr = JSONResponse.isString(v); + var isNum = (! isStr) && JSONResponse.isNumber(v); + if (isStr || (isNum && sort !== '')) { + var last = null; + for (let j = len - 1; j > 2; j--) { + last = real[len - 1]; + if ((JSONResponse.isNumber(last) && last !== 0) || (JSONResponse.isString(last) && last !== '')) { + break + } + } + + if (last == null) { + last = isNum ? 0 : ''; + } + var first = v != null ? v : (isNum ? 0 : ''); + + if (sort !== '') { // >, >=, ''; <, <=, ''; =, >=, ''; =, <=, '' + var srt = (last === first ? '=' : (last > first ? '>' : '<')); + target.sort = sort = sort == null || srt === sort ? srt : (sort.includes(srt) ? sort : (srt === '=' ? sort + '=' : '')); + } - child = JSONResponse.updateStandard(child, real[i], exceptKeys, true, key == null ? 'item' : key + 'Item'); //FIXME ignoreTrend 固定取 true 导致批量创建后多个 id [1,2,3] -> [3,4,5] 漏报趋势异常 + if (isStr && same !== '' && StringUtil.isNotEmpty(first) && StringUtil.isNotEmpty(last)) { + var sm = StringUtil.longestSubstr(first, last); + target.same = same = StringUtil.longestSubstr(same, sm); + } + } + } + + child = JSONResponse.updateStandard(child, v, exceptKeys, true, fd, '' + i, i <= 0 ? null : real[i - 1]); //FIXME ignoreTrend 固定取 true 导致批量创建后多个 id [1,2,3] -> [3,4,5] 漏报趋势异常 } if (child == null) { log('updateStandard child == null >> child = {}'); @@ -1621,7 +1732,7 @@ var JSONResponse = { } values = [child]; - target = JSONResponse.setValue(target, real.length, lengthLevel == null ? 1 : lengthLevel, lengths, true, true); + target = JSONResponse.setValue(target, len, lengthLevel == null ? 1 : lengthLevel, lengths, true, true); target = JSONResponse.setValue(target, null, valueLevel, values, false, ignoreTrend); } else if (type == 'object') { @@ -1660,15 +1771,34 @@ var JSONResponse = { continue } + var fv = firstVal[k]; + var rv = real[k]; log('updateStandard for k in real = ' + k + '; firstVal[k] = ' - + JSON.stringify(firstVal[k], null, ' ') + ';\n real[k] = ' + JSON.stringify(real[k], null, ' ') + ' >>'); - firstVal[k] = JSONResponse.updateStandard(firstVal[k], real[k], exceptKeys, ignoreTrend, k); + + JSON.stringify(fv, null, ' ') + ';\n real[k] = ' + JSON.stringify(rv, null, ' ') + ' >>'); + firstVal[k] = JSONResponse.updateStandard(fv, rv, exceptKeys, ignoreTrend, fd, k, JSONResponse.isObject(preReal) ? preReal[k] : null); } target.values = values; } else { - log('updateStandard type == other >> '); + log('updateStandard type == ' + type + ' >> '); + if (StringUtil.isNumber(key) && key >= '1' && (sort !== '' || same !== '') && type === JSONResponse.getType(preReal)) { + var isStr = JSONResponse.isString(real); + var isNum = (! isStr) && JSONResponse.isNumber(real); + if (isStr || (isNum && sort !== '')) { + if (sort !== '') { // >, >=, ''; <, <=, ''; =, >=, ''; =, <=, '' + preReal = preReal != null ? preReal : (isNum ? 0 : (isStr ? '' : preReal)); + var srt = (real === preReal ? '=' : (real > preReal ? '>' : '<')); + target.sort = sort = sort == null || srt === sort ? srt : (sort.includes(srt) ? sort : (srt === '=' ? sort + '=' : '')); + } + + if (isStr && same !== '' && StringUtil.isNotEmpty(real)) { + var sm = StringUtil.isEmpty(same) ? real : StringUtil.longestSubstr(real, same); // preReal); + target.same = same = sm; // StringUtil.longestSubstr(same, sm); + } + } + } + if (type == 'string') { var format = target.format; try { @@ -1708,7 +1838,14 @@ var JSONResponse = { log(e) try { var realObj = parseJSON(real); - var format2 = JSONResponse.updateStandard(target.format, realObj, exceptKeys, ignoreTrend, key); + var preRealObj = null; + try { + preRealObj = parseJSON(preReal); + } catch (e2) { + log(e2) + } + + var format2 = JSONResponse.updateStandard(target.format, realObj, exceptKeys, ignoreTrend, folder, key, preRealObj); if (format2 != null) { target.format = format2; } diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js index 8b35dc2a..ce75a0ee 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js @@ -878,6 +878,41 @@ var StringUtil = { } return StringUtil.trim(newStr); + }, + + longestSubstr: function(str1, str2, trim) { + if (! str1 || ! str2) { + return ""; + } + + let m = StringUtil.length(str1, trim); + let n = StringUtil.length(str2, trim); + + // 创建一个二维数组,dp[i][j] 记录以 str1[i-1] 和 str2[j-1] 结尾的公共子串长度 + let dp = Array.from(Array(m + 1), () => Array(n + 1).fill(0)); + + let maxLength = 0; // 记录最长公共子串的长度 + let endIndex = 0; // 记录最长公共子串在 str1 中结束的位置 + + for (let i = 1; i <= m; i++) { + for (let j = 1; j <= n; j++) { + // 如果当前字符相等 + if (str1[i - 1] === str2[j - 1]) { + dp[i][j] = dp[i - 1][j - 1] + 1; + + // 更新最大长度和结束索引 + if (dp[i][j] > maxLength) { + maxLength = dp[i][j]; + endIndex = i; // 这里的 i 是基于 1 的索引,对应 str1 的 endIndex + } + } else { + dp[i][j] = 0; // 不连续则清零 + } + } + } + + // 根据结束索引和最大长度,从 str1 中截取出最长公共子串 + return str1.substring(endIndex - maxLength, endIndex); } }; diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js index 473a761e..289e9876 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js @@ -12682,8 +12682,10 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea it.compareColor = 'green' it.hintMessage = '新增字段/新增值 等' break; + case JSONResponse.COMPARE_SORT_CHANGE: case JSONResponse.COMPARE_LENGTH_CHANGE: case JSONResponse.COMPARE_VALUE_CHANGE: + case JSONResponse.COMPARE_FILTER_CHANGE: it.compareColor = 'blue' it.hintMessage = '值改变 等' break; From a3de5e3d2d11bfbcc014d1cc07e4b66de9afd751 Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Mon, 19 Oct 2026 00:04:01 +0800 Subject: [PATCH 19/26] =?UTF-8?q?=E9=9B=B6=E4=BB=A3=E7=A0=81=E6=96=AD?= =?UTF-8?q?=E8=A8=80=EF=BC=9A=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8=E6=96=AD?= =?UTF-8?q?=E8=A8=80=E6=98=AF=E5=90=A6=E6=8C=89=E6=90=9C=E7=B4=A2=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E8=BF=94=E5=9B=9E=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/api/apijson/JSONResponse.js | 8 ++++---- .../main/resources/static/api/apijson/StringUtil.js | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js index b89c0231..58af86b0 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js @@ -1717,9 +1717,9 @@ var JSONResponse = { target.sort = sort = sort == null || srt === sort ? srt : (sort.includes(srt) ? sort : (srt === '=' ? sort + '=' : '')); } - if (isStr && same !== '' && StringUtil.isNotEmpty(first) && StringUtil.isNotEmpty(last)) { - var sm = StringUtil.longestSubstr(first, last); - target.same = same = StringUtil.longestSubstr(same, sm); + if (isStr && same !== '' && (StringUtil.isNotEmpty(first) || StringUtil.isNotEmpty(last))) { + var sm = StringUtil.isEmpty(first) ? last : (StringUtil.isEmpty(last) ? first : StringUtil.longestSubstr(first, last)); + target.same = same = same == null ? sm : (StringUtil.isEmpty(sm) ? same : StringUtil.longestSubstr(same, sm)); } } } @@ -1793,7 +1793,7 @@ var JSONResponse = { } if (isStr && same !== '' && StringUtil.isNotEmpty(real)) { - var sm = StringUtil.isEmpty(same) ? real : StringUtil.longestSubstr(real, same); // preReal); + var sm = same == null ? real : StringUtil.longestSubstr(real, same); // preReal); target.same = same = sm; // StringUtil.longestSubstr(same, sm); } } diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js index ce75a0ee..441b255b 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/StringUtil.js @@ -881,12 +881,15 @@ var StringUtil = { }, longestSubstr: function(str1, str2, trim) { - if (! str1 || ! str2) { - return ""; + let m = StringUtil.isString(str1) ? StringUtil.length(str1, trim) : 0; + let n = m <= 0 || ! StringUtil.isString(str2) ? 0 : StringUtil.length(str2, trim); + if (n <= 0) { + return ''; } - let m = StringUtil.length(str1, trim); - let n = StringUtil.length(str2, trim); + if (str1 === str2) { + return StringUtil.get(str1); + } // 创建一个二维数组,dp[i][j] 记录以 str1[i-1] 和 str2[j-1] 结尾的公共子串长度 let dp = Array.from(Array(m + 1), () => Array(n + 1).fill(0)); From 78152cb9beb28c6901cf0f640fac82d0590935b7 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Sun, 1 Nov 2026 21:02:02 +0800 Subject: [PATCH 20/26] test: verify login for APIAuto, UnitAuto, SQLAuto, CVAuto, AutoUI; fix: APIAuto UI offset when cursor down to bottom of script panel --- .../java/apijson/boot/DemoController.java | 75 +++++++++++++++++-- .../src/main/resources/static/api/index.html | 2 +- 2 files changed, 69 insertions(+), 8 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java index 94c1a5bc..01917e82 100644 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/DemoController.java @@ -17,9 +17,7 @@ import apijson.fastjson2.APIJSONController; import apijson.fastjson2.APIJSONParser; import apijson.fastjson2.JSONRequest; -import apijson.framework.APIJSONApplication; -import apijson.framework.APIJSONConstant; -import apijson.framework.APIJSONCreator; +import apijson.framework.*; import apijson.orm.exception.*; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; @@ -68,7 +66,6 @@ import apijson.demo.model.Privacy; import apijson.demo.model.User; import apijson.demo.model.Verify; -import apijson.framework.BaseModel; import unitauto.MethodUtil; import static apijson.JSON.getString; @@ -3320,10 +3317,16 @@ public String au() { //} @PostMapping("method/list") - public Map listMethod(@RequestBody String request) { + public Map listMethod(@RequestBody String request, HttpSession session) { if (Log.DEBUG == false) { return MethodUtil.JSON_CALLBACK.newErrorResult(new IllegalAccessException("非 DEBUG 模式下不允许使用 UnitAuto 单元测试!")); } + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return MethodUtil.JSON_CALLBACK.newErrorResult(e); + } + return MethodUtil.listMethod(request); } @@ -3351,9 +3354,19 @@ public void complete(com.alibaba.fastjson.JSONObject data, Method method, Method } }; - if (Log.DEBUG == false) { + Exception err = Log.DEBUG ? null : new IllegalAccessException("非 DEBUG 模式下不允许使用 UnitAuto 单元测试!"); + if (err == null) { try { - listener.complete(MethodUtil.JSON_CALLBACK.newErrorResult(new IllegalAccessException("非 DEBUG 模式下不允许使用 UnitAuto 单元测试!"))); + HttpSession session = servletRequest.getSession(); + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + err = e; + } + } + + if (err != null) { + try { + listener.complete(MethodUtil.JSON_CALLBACK.newErrorResult(err)); } catch (Exception e1) { e1.printStackTrace(); @@ -3384,6 +3397,12 @@ public void complete(com.alibaba.fastjson.JSONObject data, Method method, Method @GetMapping("api/test/start") public String startApiTest(HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + //response.sendRedirect("http://localhost:3000/test/start"); long id = 100000 + Math.round(899999*Math.random()); DemoParser.KEY_MAP.put(String.valueOf(id), session); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id); @@ -3391,6 +3410,12 @@ public String startApiTest(HttpSession session) { } @GetMapping("api/test/status") public String getApiTestStatus(@RequestParam(value = "key", required = false) String key, HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + //response.sendRedirect("http://localhost:3000/test/status"); DemoParser.KEY_MAP.remove(key); return delegate("http://localhost:3000/test/status", session); @@ -3398,30 +3423,60 @@ public String getApiTestStatus(@RequestParam(value = "key", required = false) St @GetMapping("unit/test/start") public String startUnitTest(HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + long id = 100000 + Math.round(899999*Math.random()); DemoParser.KEY_MAP.put(String.valueOf(id), session); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id); return delegate("http://localhost:3001/test/start?key=" + id, session); } @GetMapping("unit/test/status") public String getUnitTestStatus(@RequestParam(value = "key", required = false) String key, HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + DemoParser.KEY_MAP.remove(key); return delegate("http://localhost:3001/test/status", session); } @GetMapping("sql/test/start") public String startSQLTest(HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + long id = 100000 + Math.round(899999*Math.random()); DemoParser.KEY_MAP.put(String.valueOf(id), session); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id); return delegate("http://localhost:3002/test/start?key=" + id, session); } @GetMapping("sql/test/status") public String getSQLTestStatus(@RequestParam("key") String key, HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + DemoParser.KEY_MAP.remove(key); return delegate("http://localhost:3002/test/status", session); } @GetMapping("cv/test/start") public String startCvTest(HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + //response.sendRedirect("http://localhost:3003/test/start"); long id = 100000 + Math.round(899999*Math.random()); DemoParser.KEY_MAP.put(String.valueOf(id), session); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id); @@ -3429,6 +3484,12 @@ public String startCvTest(HttpSession session) { } @GetMapping("cv/test/status") public String getCvTestStatus(@RequestParam(value = "key", required = false) String key, HttpSession session) { + try { + COMMON_PARSER.getVerifier().setVisitor(APIJSONVerifier.getVisitor(session)).verifyLogin(); + } catch (Exception e) { + return JSON.toJSONString(COMMON_PARSER.newErrorResult(e)); + } + //response.sendRedirect("http://localhost:3003/test/status"); DemoParser.KEY_MAP.remove(key); return delegate("http://localhost:3003/test/status", session); diff --git a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html index 669bb858..46298f4b 100755 --- a/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html +++ b/APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/index.html @@ -640,7 +640,7 @@