From efb4f6a362fd2fb00ff363e0dd1344451b2da87f Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Tue, 27 May 2025 23:32:35 +0800
Subject: [PATCH 01/64] =?UTF-8?q?=E6=96=B0=E5=A2=9E=208.0=20=E7=89=88?=
=?UTF-8?q?=E5=AE=9E=E8=B7=B5=E5=8D=9A=E6=96=87=EF=BC=9A=E8=85=BE=E8=AE=AF?=
=?UTF-8?q?=E5=BC=80=E6=BA=90=EF=BC=81=E9=9B=B6=E4=BB=A3=E7=A0=81=EF=BC=8C?=
=?UTF-8?q?=E5=85=A8=E8=87=AA=E5=8A=A8=E4=B8=87=E8=83=BDAPI=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
创作不易,点赞、收藏、转发支持热心的文章作者吧~
https://mp.weixin.qq.com/s/WWndAa68BqBfflWgL5592A
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index edc82100..858c4f5c 100644
--- a/README.md
+++ b/README.md
@@ -633,6 +633,8 @@ Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任
[APIJSON快速入门-零后端代码,接口所见即所得](https://www.toutiao.com/article/7503844050689376783)
+[腾讯开源!零代码,全自动万能API接口](https://mp.weixin.qq.com/s/WWndAa68BqBfflWgL5592A)
+
### 生态项目
[APIJSON-Demo](https://github.com/APIJSON/APIJSON-Demo) APIJSON 各种语言、各种框架 的 使用示例项目、上手文档、测试数据 SQL 文件 等
From 38dfb9335df47216fe84d52eee255c919d2e2e6a Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 8 Jun 2025 19:49:40 +0800
Subject: [PATCH 02/64] =?UTF-8?q?=E7=94=9F=E6=80=81=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=20apijson-gson=20=E5=92=8C=20apijson-fastjso?=
=?UTF-8?q?n2=20=E8=BF=99=E4=B8=A4=E4=B8=AA=20JSON=20=E5=BA=8F=E5=88=97?=
=?UTF-8?q?=E5=8C=96=E5=92=8C=E5=8F=8D=E5=BA=8F=E5=88=97=E5=8C=96=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
创作不易,右上角点 ⭐Star 来支持/收藏下吧,谢谢 ^_^
https://github.com/APIJSON/apijson-gson
https://github.com/APIJSON/apijson-fastjson2
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 858c4f5c..098c17fc 100644
--- a/README.md
+++ b/README.md
@@ -646,6 +646,10 @@ Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任
[apijson-column](https://github.com/APIJSON/apijson-column) APIJSON 的字段插件,支持 字段名映射 和 !key 反选字段
+[apijson-gson](https://github.com/APIJSON/apijson-gson) APIJSON 的 gson 插件,简化使用
+
+[apijson-fastjson2](https://github.com/APIJSON/apijson-fastjson2) APIJSON 的 fastjson2 插件,简化使用
+
[apijson-milvus](https://github.com/APIJSON/apijson-milvus) APIJSON 的 Milvus AI 向量数据库插件
[apijson-influxdb](https://github.com/APIJSON/apijson-influxdb) APIJSON 的 InfluxDB 物联网时序数据库插件
From a25bbc57d633792c83ac8d99748515fc04d52614 Mon Sep 17 00:00:00 2001
From: TommyLemon
From 0d235f3ba41de331d8f33889c7a29a0c62753378 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=97=A0=E7=A5=9EV?=
<72117341+wu-sv@users.noreply.github.com>
Date: Tue, 16 Sep 2025 09:24:12 +0800
Subject: [PATCH 30/64] =?UTF-8?q?=E4=BF=AE=E5=A4=8DgetConnectionKey?=
=?UTF-8?q?=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8=E5=8F=82=E6=95=B0=E5=90=8D?=
=?UTF-8?q?=E7=A7=B0=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
https://gitee.com/Tencent/APIJSON/pulls/10
---
APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
index 4d6d28c0..797ac3de 100755
--- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
+++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
@@ -1315,7 +1315,7 @@ public Connection getConnection(@NotNull SQLConfig
+
From af347bca178da94f6605244be98790ab966a9ea3 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sat, 29 Nov 2025 19:15:47 +0800
Subject: [PATCH 35/64] =?UTF-8?q?=E7=99=BB=E8=AE=B0=E6=96=87=E7=AB=A0=20[A?=
=?UTF-8?q?PIJSON=EF=BC=9A=E9=87=8D=E6=96=B0=E5=AE=9A=E4=B9=89=E5=90=8E?=
=?UTF-8?q?=E7=AB=AF=E5=BC=80=E5=8F=91=E4=BD=93=E9=AA=8C=E7=9A=84=E9=9B=B6?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81ORM=E6=A1=86=E6=9E=B6](https://blog.csdn.net/?=
=?UTF-8?q?gitblog=5F01177/article/details/155216163)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
感谢文章作者的贡献,大家 点赞、收藏、转发 支持热心的 TA 吧~
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index e3793602..caadbc9f 100644
--- a/README.md
+++ b/README.md
@@ -633,6 +633,8 @@ Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任
[springboot整合APIJSON——零代码万能通用 API(附源码)](https://blog.csdn.net/longzhutengyue/article/details/150579233)
+[APIJSON:重新定义后端开发体验的零代码ORM框架](https://blog.csdn.net/gitblog_01177/article/details/155216163)
+
### 生态项目
[APIJSON-Demo](https://github.com/APIJSON/APIJSON-Demo) APIJSON 各种语言、各种框架 的 使用示例项目、上手文档、测试数据 SQL 文件 等
From 78c77a4f3e47e44a50aeb10ea88312562f586473 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 7 Dec 2025 19:54:39 +0800
Subject: [PATCH 36/64] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E4=B8=BA=208.1.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
APIJSONORM/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/APIJSONORM/pom.xml b/APIJSONORM/pom.xml
index bd340fa5..13c5d0bf 100644
--- a/APIJSONORM/pom.xml
+++ b/APIJSONORM/pom.xml
@@ -5,7 +5,7 @@
+
@@ -694,7 +695,7 @@ Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任
[uliweb-apijson](https://github.com/zhangchunlin/uliweb-apijson) Python 版 APIJSON,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite 等
-[panda-base](https://gitee.com/digithub/panda-base) APIJSON 的 Rust 版,一个优雅、高性能的 Rust 多数据源管理系统,支持 MySQL 和 PostgreSQL
+[apijson-rust](https://gitee.com/APIJSON/panda-base) APIJSON 的 Rust 版,一个优雅、高性能的 Rust 多数据源管理系统,支持 MySQL 和 PostgreSQL
[APIJSONParser](https://github.com/Zerounary/APIJSONParser) 第三方 APIJSON 解析器,将 JSON 动态解析成 SQL
From 906e7961f7995ead0c981104c37586367f053a6d Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Mon, 19 Jan 2026 01:04:46 +0800
Subject: [PATCH 40/64] =?UTF-8?q?Java=EF=BC=9A=E5=88=A0=E9=99=A4=E5=A4=9A?=
=?UTF-8?q?=E4=BD=99=E7=9A=84=20application.properties?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
APIJSONORM/src/main/resources/application.properties | 0
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100755 APIJSONORM/src/main/resources/application.properties
diff --git a/APIJSONORM/src/main/resources/application.properties b/APIJSONORM/src/main/resources/application.properties
deleted file mode 100755
index e69de29b..00000000
From 4fe61afdf7e926c29565f682c4ff07728625765f Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 1 Feb 2026 19:00:14 +0800
Subject: [PATCH 41/64] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=87=E7=AB=A0=20?=
=?UTF-8?q?=E8=85=BE=E8=AE=AF=E5=BC=80=E6=BA=90=E7=9A=84=20APIJSON?=
=?UTF-8?q?=EF=BC=9A=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=E4=B8=8D=E7=94=A8?=
=?UTF-8?q?=E5=86=99=E4=BA=86=EF=BC=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
感谢 积厚源码 的贡献,点赞、收藏、转发支持热心的作者吧 ^_^
https://mp.weixin.qq.com/s/zhkfG4AQEsg0N87lhStwvw
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 46d3ecda..72e15ba6 100644
--- a/README.md
+++ b/README.md
@@ -638,6 +638,8 @@ Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任
[API自动生成这么爽?实测腾讯APIJSON,零代码就能玩转后端接口!](https://mp.weixin.qq.com/s/DmMIGHHcZ783KobGecMxGg)
+[腾讯开源的 APIJSON:后端接口不用写了?](https://mp.weixin.qq.com/s/zhkfG4AQEsg0N87lhStwvw)
+
### 生态项目
[APIJSON-Demo](https://github.com/APIJSON/APIJSON-Demo) APIJSON 各种语言、各种框架 的 使用示例项目、上手文档、测试数据 SQL 文件 等
From 795231b86f082c6a8f583082eddd8dc4e2d70112 Mon Sep 17 00:00:00 2001
From: TommyLemon 🏆 实时 零代码、全功能、强安全 ORM 库 🚀
+ English
+ 通用文档
+ 视频教程
+ 测试用例
+ AI 问答
+
+
+
+ APIJSON 多表关联查询、结构自由组合,APIAuto 多个测试账号、一键共享测试用例
+
+ APIAuto 自动生成前端(客户端)请求代码 和 Python 测试用例代码,一键下载
+
+ APIAuto 自动保存请求记录、自动生成接口文档,可添加常用请求、快捷查看一键恢复
+
+ APIAuto 一键自动接口回归测试,不需要写任何代码(注解、注释等全都不要)
+ 🏆 Tencent Top 6 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀
- 中文版
- Document
- Video
- Test
- Ask AI
-
-
-
- APIAuto: generate request code for frontend/clients or Python test cases, easily download code
-
- APIAuto: auto save test records, auto generate API doc, requests shortcut, easily replay
-
- APIAuto: auto regression test without code, annotation, comment, etc.)
-
- A picture is worth a thousand words - some basic features show for APIJSON
- 🏆 实时 零代码、全功能、强安全 ORM 库 🚀 🏆 Tencent Top 6 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀
- English
- 通用文档
- 视频教程
- 测试用例
- AI 问答
+ 中文版
+ Document
+ Video
+ Test
+ Ask AI
- APIJSON 多表关联查询、结构自由组合,APIAuto 多个测试账号、一键共享测试用例
+ APIJSON: query multi related tables, flexible data structures. APIAuto: multi test accounts, easily share test cases
- APIAuto 自动生成前端(客户端)请求代码 和 Python 测试用例代码,一键下载
+ APIAuto: generate request code for frontend/clients or Python test cases, easily download code
- APIAuto 自动保存请求记录、自动生成接口文档,可添加常用请求、快捷查看一键恢复
+ APIAuto: auto save test records, auto generate API doc, requests shortcut, easily replay
- APIAuto 一键自动接口回归测试,不需要写任何代码(注解、注释等全都不要)
+ APIAuto: auto regression test without code, annotation, comment, etc.)
- 一图胜千言 - APIJSON 部分基础功能概览
+ A picture is worth a thousand words - some basic features show for APIJSON
+ [GIF] APIJSON 各种单表对象查询:简单查询、统计、分组、排序、聚合、比较、筛选字段、字段别名 等
+
+ [GIF] APIJSON 各种单表数组查询:简单查询、统计、分组、排序、聚合、分页、比较、搜索、正则、条件组合 等
+
+ [GIF] APIJSON 各种多表关联查询:一对一、一对多、多对一、各种条件 等
+
+ [GIF] APIJSON 各种 JOIN:< LEFT JOIN, & INNER JOIN 等
+
+ [GIF] APIJSON 各种子查询:@from@ FROM, key@ =, key>@ >, key{}@ IN, key}{@ EXISTS 等
+
+ [GIF] APIJSON 部分功能演示集合,由浅入深、由简单到复杂
+
- [GIF] APIJSON joins: < LEFT JOIN, & INNER JOIN, etc.
-
- [GIF] APIJSON subqueries:@from@ FROM, key@ =, key>@ >, key{}@ IN, key}{@ EXISTS, etc.
-
- [GIF] APIJSON: a set of some features, simple to complex
-
- [GIF] APIJSON 各种单表对象查询:简单查询、统计、分组、排序、聚合、比较、筛选字段、字段别名 等
+ [GIF] APIJSON single objects: simple queries, statistics, groups, orders, aggregations, comparisons, filters, aliases, etc.
- [GIF] APIJSON 各种单表数组查询:简单查询、统计、分组、排序、聚合、分页、比较、搜索、正则、条件组合 等
+ [GIF] APIJSON single arrays: simple queries, statistics, groups, orders, aggregations, paginations, searches, regexps, combinations, etc.
- [GIF] APIJSON 各种多表关联查询:一对一、一对多、多对一、各种条件 等
+ [GIF] APIJSON query multi related tables: one to one, one to many, many to one, various conditions, etc.
- [GIF] APIJSON 各种 JOIN:< LEFT JOIN, & INNER JOIN 等
+ [GIF] APIJSON joins: < LEFT JOIN, & INNER JOIN, etc.
- [GIF] APIJSON 各种子查询:@from@ FROM, key@ =, key>@ >, key{}@ IN, key}{@ EXISTS 等
+ [GIF] APIJSON subqueries:@from@ FROM, key@ =, key>@ >, key{}@ IN, key}{@ EXISTS, etc.
- [GIF] APIJSON 部分功能演示集合,由浅入深、由简单到复杂
+ [GIF] APIJSON: a set of some features, simple to complex
🏆 Tencent Top 6 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀
- 中文版
- Document
- Video
- Test
- Ask AI
-
🏆 实时 零代码、全功能、强安全 ORM 库 🚀
- English
- 通用文档
+ English
+ 通用文档
视频教程
测试用例
AI 问答
From fd32a8dd15d79910c8b916d92348b5bf9eff48e8 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 16:29:27 +0800
Subject: [PATCH 46/64] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 239f4dc9..20452f98 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ This source code is licensed under the Apache License Version 2.0 🏆 Tencent Top 6 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀 🏆 Tencent Top 5 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀
🏆 实时 零代码、全功能、强安全 ORM 库 🚀
- English
+ English
通用文档
视频教程
测试用例
From d25088727b829d6aaa7e79c1245ed693c40e7ca5 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 16:33:30 +0800
Subject: [PATCH 48/64] Update README.md
---
README.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/README.md b/README.md
index 20452f98..9cbc1ab7 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,14 @@ This source code is licensed under the Apache License Version 2.0 🏆 Tencent Top 5 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀
+ 中文版
+ Document
+ Video
+ Test
+ Ask AI
+
🏆 Tencent Top 5 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀
- 中文版
- Document
+ 中文版
+ Document
Video
Test
Ask AI
From 2f3e7bd0610ef239705b6b74fa96e6f18f2a3d69 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 16:37:30 +0800
Subject: [PATCH 50/64] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3953e029..3b28a95c 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ This source code is licensed under the Apache License Version 2.0 🏆 Tencent Top 5 Open Source Project, Achieved 5 Awards Inside & Outside Tencent 🚀 🏆 Real-Time coding-free, powerful and secure ORM 🚀
中文版
From 5c4b2a29afff336ff9fd7bea6b4c256e443e1208 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 17:25:13 +0800
Subject: [PATCH 51/64] Update README.md
---
README.md | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 3b28a95c..1104465d 100644
--- a/README.md
+++ b/README.md
@@ -84,8 +84,6 @@ This source code is licensed under the Apache License Version 2.0 🏆 Real-Time coding-free, powerful and secure ORM 🚀 🏆 Real-Time coding-free, powerful and secure ORM 🚀
中文版
From 60e873d440bb11236820fdc3a7fcf697687c36f5 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 22 Feb 2026 04:05:58 +0800
Subject: [PATCH 62/64] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9f45d0b4..bd7b039d 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ This source code is licensed under the Apache License Version 2.0 🏆 Real-Time coding-free, powerful and secure ORM 🚀 🏆 Real-Time no-code, powerful and secure ORM 🚀
中文版
From e6840d00348488ea47ff7a60610b57a51d3c0a4a Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 22 Feb 2026 04:13:37 +0800
Subject: [PATCH 63/64] Authors of other projects for ecosystem of APIJSON(2
Tencent engineers, 1 BAT(Baidu/Alibaba/Tencent) expert ...
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index bd7b039d..b4a56e51 100644
--- a/README.md
+++ b/README.md
@@ -344,7 +344,7 @@ https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
+Copyright (C) 2020 Tencent. All rights reserved.
+This source code is licensed under the Apache License Version 2.0
+
+
+ APIJSON
+
+
+
后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+APIJSON 是一种专为 API 而生的 JSON 网络传输协议 以及 基于这套协议实现的 ORM 库。
+为各种增删改查提供了完全自动化的万能通用接口,零代码实时满足千变万化的各种新增和变更需求。
+能大幅降低开发和沟通成本,简化开发流程,缩短开发周期。
+适合中小型前后端分离的项目,尤其是 创业项目、内部项目、低代码/零代码、小程序、BaaS、Serverless 等。
+
+通过万能通用接口,前端可以定制任何数据、任何结构。
+大部分 HTTP 请求后端再也不用写接口了,更不用写文档了。
+前端再也不用和后端沟通接口或文档问题了。再也不会被文档各种错误坑了。
+后端再也不用为了兼容旧接口写新版接口和文档了。再也不会被前端随时随地没完没了地烦了。
+
+### 特点功能
+
+#### 对于后端
+* 提供万能通用接口,大部分 HTTP API 不用再写
+* 零代码增删改查、各种跨库连表、JOIN 嵌套子查询等
+* 自动生成文档,不用再编写和维护,且自动静态检查
+* 自动校验权限、自动管理版本、自动防 SQL 注入
+* 开放 HTTP API 无需划分版本,始终保持兼容
+
+#### 对于前端
+* 不用再向后端催接口、求文档
+* 数据和结构完全定制,要啥有啥
+* 看请求知结果,所求即所得
+* 可一次获取任何数据、任何结构
+* 能去除多余数据,节省流量提高速度
+
+
+
+### APIJSON 接口展示
+#### Postman 展示 APIJSON
+
+
+
+#### APIAuto 展示 APIJSON
+**使用 APIAuto-机器学习接口工具 来管理和测试 HTTP API 可大幅 减少传参错误、提升联调效率**
+(注意网页工具界面是 APIAuto,里面的 URL+JSON 才是 APIJSON 的 HTTP API):
+
+
+
+
+
+
+
+
+
+
+
+
+
+### APIJSON App 演示
+使用 APIJSON + ZBLibrary 开发的 Android 客户端 Demo (以下 Gif 图看起来比较卡,实际上运行很流畅):
+
+
+
+
+
+
+
+### APIJSON 分享演讲
+#### APIJSON-零代码接口与文档 ORM 库(国际开源谷 Gitee Meetup)
+
+https://www.bilibili.com/video/BV1Tv411t74v
+
+
+
+
+#### APIJSON 和 APIAuto-零代码开发和测试(QECon 全球软件质量&效能大会)
+
+https://www.bilibili.com/video/BV1yv411p7Y4
+
+
+
+
+
+
+### 为什么选择 APIJSON?
+前后端 关于接口的 开发、文档、联调 等 10 大痛点解析
+https://github.com/Tencent/APIJSON/wiki
+
+* **解决十大痛点** (可帮前后端开发大幅提振开发效率、强力杜绝联调扯皮、巧妙规避文档缺陷、非常节省流量带宽)
+* **开发提速很大** (CRUD 零代码热更新全自动,APIJSONBoot 对比 SSM、SSH 等保守估计可提速 20 倍以上)
+* **腾讯官方开源** (使用 GitHub、Gitee、工蜂 等平台的官方账号开源,微信公众号、腾讯云+社区 等官方公告)
+* **社区影响力大** (GitHub 18K+ Star 在 400W Java 项目排名前 100,远超 FLAG, BAT 等国内外绝大部分开源项目)
+* **各项荣誉成就** (腾讯内外 5 个奖项、腾讯开源前五、腾讯后端 Star 第一、Trending 日周月榜大满贯 等)
+* **多样用户案例** (腾讯内有互娱、音乐、微信、云与智慧,外部有华为、华能、百度、快手、中兴、圆通、传音等)
+* **适用场景广泛** (社交聊天、阅读资讯、影音娱乐、办公学习 等各种 App、网站、小程序、公众号 等非金融类项目)
+* **周边生态丰富** (Android, iOS, Web 等各种 Demo、继承 JSON 的海量生态、零代码 接口测试 和 单元测试 工具等)
+* **文档视频齐全** (项目介绍、快速上手、安装部署 等后端、前端、客户端的 图文解说、视频教程、代码注释 等)
+* **功能丰富强大** (增删改查、分页排序、分组聚合、各种条件、各种 JOIN、各种子查询、跨库连表 等零代码实现)
+* **使用安全简单** (自动增删改查、自动生成文档、自动管理版本、自动控制权限、自动校验参数、自动防 SQL 注入)
+* **灵活定制业务** (在后端编写 远程函数,可以拿到 session、version、当前 JSON 对象 等,然后自定义处理)
+* **高质可靠代码** (代码严谨规范,蚂蚁集团源伞 Pinpoint 代码扫描分析报告平均每行代码 Bug 率低至 0.15%)
+* **兼容各种项目** (协议不限 HTTP,与其它库无冲突,对各类 Web 框架集成友好且提供 SpringBoot, JFinal 的示例)
+* **工程轻量小巧** (无第三方依赖,Jar 仅 263KB,Java 文件仅 68 个共 14864 行代码,例如 APIJSONORM 8.1.0)
+* **多年持续迭代** (自 2016 年起已连续维护 8 年多,70+ 贡献者、100+ 发版、3000+ 提交,不断更新迭代中...)
+
+**按照一般互联网中小型项目情况可得出以下对比表格:**
+
+表数量 T | 平均每表字段数 C | SSMH 按快估计 | APIJSONBoot 按慢估计 | APIJSONBoot 提速倍数
+-------- | --------- | --------------------- | ------------------ | -----------
+1 | 3 | 179 min(约一上午) | 11 min(约十分钟) | 15.27
+5 | 4 | 1935 min(约朝九晚六一周) | 70 min(约一小时) | 26.64
+10 | 10 | 8550 min(大小周超半个月) | 320 min(约一下午) | 25.72
+20 | 15 | 31900 min(约 996 两个月) | 940 min(约上班两天) | 32.94
+50 | 20 | 176750 min(11117 超半年) | 3100 min(约上班一周) | 56.02
+
+### 用户反馈
+**腾讯 IEG 数据产品开发组负责人 xinlin:**
+“腾讯的 APIJSON 开源方案,它可以做到零代码生成接口和文档,并且整个生成过程是自动化。当企业有元数据的时候,马上就可以获得接口”
+
+**腾讯科技 后台开发高级工程师 雷大锤:**
+“可以抽出时间来看apijson了,这个可以为T10做准备,也是业界很火的东西,可以提升个人影响力!”
+
+**腾讯 bodian520:**
+“在调试GET、POST、PUT接口时遇到了一些问题,把个人的摸索经验分享一下,希望作者能梳理下文档,方便我们更好的接入”
+
+**华为 minshiwu:**
+“demo工程,默认使用apijson-framework,可以做到无任何配置即可体验apijson的各种能力。”
+
+**字节跳动 qiujunlin:**
+“初次见到这个项目,觉得太惊艳了,眼前一亮。给我的感受是,项目大大简化了开发流程,开发效率提升了很多倍。”
+
+**百度智慧城市研发 lpeng:**
+“很兴奋的发现APIJSON很适合我们的一个开发场景,作为我们协议定义的一部分”
+
+**中兴 duyijiang:**
+“感谢腾讯大大提供的框架,很好用”
+
+https://github.com/Tencent/APIJSON/issues/132#issuecomment-1106669540
+
+
+
+### 常见问题
+#### 1.如何定制业务逻辑?
+在后端编写 远程函数,可以拿到 session、version、当前 JSON 对象、参数名称 等,然后对查到的数据自定义处理
+https://github.com/Tencent/APIJSON/issues/101
+
+#### 2.如何控制权限?
+在 Access 表配置校验规则,默认不允许访问,需要对 每张表、每种角色、每种操作 做相应的配置,粒度细分到行级
+https://github.com/Tencent/APIJSON/issues/12
+
+#### 3.如何校验参数?
+在 Request 表配置校验规则 structure,提供 MUST、TYPE、VERIFY 等通用方法,可通过 远程函数 来完全自定义
+https://github.com/Tencent/APIJSON/wiki#%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86
+
+更多常见问题及提问前必看
+https://github.com/Tencent/APIJSON/issues/36
+
+
+### 注意事项
+**请求参数 JSON 中表名、字段名、关键词及对应的值都是大小写敏感、逗号敏感、分号敏感、空格敏感、换行敏感,
+大部分情况都不允许空格和换行,表名以大写字母开头,不要想当然,请严格按照 [设计规范](https://github.com/Tencent/APIJSON/blob/master/Document.md#3) 来调用 API !**
+[#181](https://github.com/Tencent/APIJSON/issues/181)
+
+
+
+
+
+导航目录: [项目简介](#--apijson) 上手使用 [社区生态](#%E6%8A%80%E6%9C%AF%E4%BA%A4%E6%B5%81) 完整详细的导航目录 [点这里查看](/Navigation.md)
+
+### 快速上手
+
+#### 1.后端上手
+可以跳过这个步骤,直接用APIJSON服务器IP地址 apijson.cn:8080 来测试接口。
+见 [APIJSON后端上手 - Java](https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server)
+
+#### 2.前端上手
+可以跳过这个步骤,直接使用 [APIAuto-机器学习HTTP接口工具](https://github.com/TommyLemon/APIAuto) 或 下载客户端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)
+
+
+### 下载客户端 App
+
+仿微信朋友圈动态实战项目
+[APIJSONApp.apk](http://files.cnblogs.com/files/tommylemon/APIJSONApp.apk)
+
+测试及自动生成代码工具
+[APIJSONTest.apk](http://files.cnblogs.com/files/tommylemon/APIJSONTest.apk)
+
+### 开源许可
+使用 [Apache License 2.0](/LICENSE),对 公司、团队、个人 等 商用、非商用 都自由免费且非常友好,请放心使用和登记
+
+### 使用登记
+如果您在使用 APIJSON,请让我们知道,您的使用对我们非常重要(新的按登记顺序排列、专群优先答疑解惑):
+https://github.com/Tencent/APIJSON/issues/187
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ * [腾讯科技有限公司](https://www.tencent.com)
+ * [腾讯音乐娱乐集团](https://www.tencentmusic.com)
+ * [深圳市传音通讯有限公司](https://www.transsion.com)
+ * [社宝信息科技(上海)有限公司](https://shebaochina.com)
+ * [华能贵诚信托有限公司](https://www.hngtrust.com)
+ * [投投科技](https://www.toutou.com.cn)
+ * [圆通速递](https://www.yto.net.cn)
+ * [乐拼科技](https://www.lepinyongche.com)
+ * [珠海采筑电子商务有限公司](https://www.aupup.com)
+ * [爱投斯智能技术(深圳)有限公司](http://www.aiotos.net)
+ * [邻盛科技(武汉)有限公司](http://www.linksame.com)
+ * [上海麦市信息科技有限公司](https://www.masscms.com)
+ * [上海翊丞互联网科技有限公司](http://www.renrencjl.com/home)
+ * [上海直真君智科技有限公司](http://www.zzjunzhi.com)
+ * [北明软件有限公司](https://www.bmsoft.com.cn/)
+ * [上海钰亿环保科技有限公司](#)
+
+### 贡献者们
+主项目 APIJSON 的贡献者们(6 个腾讯工程师、1 个微软工程师、1 个阿里云工程师、1 个字节跳动工程师、1 个网易工程师、1 个 Zoom 工程师、1 个圆通工程师、1 个知乎基础研发架构师、1 个智联招聘工程师、gorm-plus 作者、1 个美国加州大学学生、3 个 SUSTech 学生等):
+https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+生态周边项目的作者们(2 个腾讯工程师、1 个 BAT 技术专家、1 个微软工程师、2 个字节跳动工程师、1 个神州数码工程师&Apache dubbo2js 作者 等):
+https://github.com/search?o=desc&q=apijson&s=stars&type=Repositories
+https://search.gitee.com/?skin=rec&type=repository&q=apijson&sort=stars_count
+
+
+
+还有为 APIJSON 扫描代码贡献 Issue 的 [蚂蚁集团源伞](https://www.sourcebrella.com) 和 [奇安信代码卫士](https://github.com/QiAnXinCodeSafe)
+
+
+
+感谢大家的贡献。
+
+### 统计分析
+腾讯、华为、阿里巴巴、美团、字节跳动、百度、京东、网易、快手等和 Google, Apple, Microsoft, Amazon, Paypal, IBM, Shopee 等
+数百名知名大厂员工点了 Star,也有腾讯、华为、字节跳动、Microsoft、Zoom 等不少知名大厂员工提了 PR/Issue,感谢大家的支持~
+[](https://starchart.cc/Tencent/APIJSON)
+
+
+
+
+根据开源指南针报告,APIJSON Java 版已经是国内顶级、国际一流的 Java 开源项目了 [#518](https://github.com/Tencent/APIJSON/issues/518)
+
+
+### 规划及路线图
+新增功能、强化安全、提高性能、增强稳定、完善文档、丰富周边、推广使用
+https://github.com/Tencent/APIJSON/blob/master/Roadmap.md
+
+理论上所有支持 SQL 与 JDBC/ODBC 的软件,都可以用本项目对接 CRUD,待测试:
+[OceanBase](https://www.oceanbase.com/docs/oceanbase/V2.2.50/ss-sr-select_daur3l), [Spark](https://spark.apache.org/docs/3.3.0/sql-ref-syntax-qry-select.html)(可用 Hive 对接), [Phoenix](http://phoenix.apache.org/language/index.html#select)(延伸支持 HBase)
+
+### 我要赞赏
+创作不易,坚持更难,右上角点 ⭐Star 来支持/收藏下吧,谢谢 ^_^
+https://github.com/Tencent/APIJSON
+
+
+
+
+
+导航目录: [项目简介](#--apijson) [上手使用](#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B) 社区生态 完整详细的导航目录 [点这里查看](/Navigation.md)
+
+### 技术交流
+如果有什么问题或建议可以 [填问卷](https://wj.qq.com/s2/10971431/2a09) 或 [提 Issue](https://github.com/Tencent/APIJSON/issues/36),交流技术,分享经验。
+如果你解决了某些 bug,或者新增了一些功能,欢迎 [贡献代码](https://github.com/Tencent/APIJSON/pulls),感激不尽~
+https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
+
+**开发者也是人,也需要工作、休息、恋爱、陪伴家人、走亲会友等,也有心情不好和身体病痛,**
+**往往没有额外的时间精力顾及一些小问题,请理解和支持,开源要大家参与贡献才会更美好~**
+**少数个人的热情终有被耗尽的一天,只有大家共同建设和繁荣社区,才能让开源可持续发展!**
+
+**开发者时间精力有限,原则上优先解决 登记用户 和 贡献者 的问题,**
+**不解决 文档/视频/常见问题 已明确说明、描述简陋 或 态度无礼 的问题!**
+**如果你已经多次得到帮助,却仍然只索取不贡献,那就别指望大家再帮你!**
+**私聊作者请教技术问题 或者 频繁在互助群 @ 作者 可能会被拉黑/禁言/踢群,请尊重和理解,谢谢!**
+
+如果你 [提 PR 登记了自己使用 APIJSON 的公司](https://github.com/Tencent/APIJSON/issues/187),可以加 **企业用户支持专群**,作者亲自且优先答疑,
+作者只有解答完了这个专群里的全部问题,才看情况解答 Issue/问卷 里的问题(对 Issue/问卷 不保证解答、更不保证及时);
+之前的几个互助群,由于大多数问题 在文档/Issue 已有答案却反复提 或者 缺少必要信息要来来回回沟通问清细节 已浪费太多时间,
+甚至有白嫖还把自己当大爷的自私自利伸手党输出情绪,我们不再支持,建议未登记企业的用户 [填问卷](https://wj.qq.com/s2/10971431/2a09) 或 [提 Issue](https://github.com/Tencent/APIJSON/issues/36)。
+
+如果你为 APIJSON 做出了以下任何一个贡献,我们将优先为你答疑解惑:
+[提交了 PR 且被合并](https://github.com/Tencent/APIJSON/pull/92)、[提交了优质 Issue](https://github.com/Tencent/APIJSON/issues/189)、[发表了优质文章](https://blog.csdn.net/qq_41829492/article/details/88670940)、[开发了可用的生态项目](https://github.com/zhangchunlin/uliweb-apijson),
+Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任职企业的用户 > 其他用户。
+
+
+### 相关推荐
+[APIJSON, 接口和文档的终结者!](https://my.oschina.net/tommylemon/blog/805459)
+
+[腾讯业务百万数据 6s 响应,APIJSON 性能优化背后的故事](https://my.oschina.net/tommylemon/blog/5375645)
+
+[仿QQ空间和微信朋友圈,高解耦高复用高灵活](https://my.oschina.net/tommylemon/blog/885787)
+
+[后端开挂:3行代码写出8个接口!](https://my.oschina.net/tommylemon/blog/1574430)
+
+[后端自动化版本管理,再也不用改URL了!](https://my.oschina.net/tommylemon/blog/1576587)
+
+[3步创建APIJSON后端新表及配置](https://my.oschina.net/tommylemon/blog/889074)
+
+[APIJSON对接分布式HTAP数据库TiDB](https://my.oschina.net/tommylemon/blog/3081913)
+
+[APIJSON教程(一):上手apijson项目,学习apijson语法,并实现持久层配置](https://zhuanlan.zhihu.com/p/375681893)
+
+[apijson简单demo](https://blog.csdn.net/dmw412724/article/details/113558115)
+
+[apijson简单使用](https://www.cnblogs.com/greyzeng/p/14311995.html)
+
+[APIJSON简单部署和使用](https://blog.csdn.net/m450744192/article/details/108462611)
+
+[学习自动化接口APIJSON](https://www.jianshu.com/p/981a2a630c7b)
+
+[APIJSON 接口调试实践](https://github.com/Tencent/APIJSON/issues/189)
+
+[APIJSON-零代码接口和文档 JSON 协议 与 ORM 库](https://cloud.tencent.com/developer/article/2077042)
+
+[APIJSON使用例子总结](https://blog.csdn.net/weixin_41077841/article/details/110518007)
+
+[APIJSON 自动化接口和文档的快速开发神器 (一)](https://blog.csdn.net/qq_41829492/article/details/88670940)
+
+[APIJSON在mac电脑环境下配置去连接SQL Server](https://juejin.im/post/5e16d21ef265da3e2e4f4956)
+
+[APIJSON复杂业务深入实践(类似12306订票系统)](https://blog.csdn.net/aa330233789/article/details/105309571)
+
+[新手搭建 APIJSON 项目指北](https://github.com/jerrylususu/apijson_todo_demo/blob/master/FULLTEXT.md)
+
+[使用APIJSON写低代码Crud接口](https://blog.csdn.net/weixin_42375862/article/details/121654264)
+
+[apijson在同一个接口调用中 使用远程函数写入更新时间和创建时间](https://blog.csdn.net/qietingfengsong/article/details/124097229)
+
+[APIJSON(一:综述)](https://blog.csdn.net/qq_50861917/article/details/120556168)
+
+[APIJSON 代码分析(三:demo主体代码)](https://blog.csdn.net/qq_50861917/article/details/120751630)
+
+[APIJSON 代码分析(二)AbstractParser类(解析器)](https://blog.csdn.net/weixin_45767055/article/details/120815927)
+
+[APIJSON 代码分析(四:AbstractObjectParser源码阅读)](https://blog.csdn.net/qq_50861917/article/details/120896381)
+
+[APIJSON 代码分析 AbstractSQLConfig 第二篇](https://blog.csdn.net/csascscascd/article/details/120684889)
+
+[APIJSON 代码分析(六)APIJSON—Verifier检查类](https://blog.csdn.net/weixin_45767055/article/details/121321731)
+
+[APIJSON 代码分析(四)AbstractSQLExecutor—SQL执行器](https://blog.csdn.net/weixin_45767055/article/details/121069887)
+
+[APIJSON使用](https://juejin.cn/post/7148253873478565902)
+
+[apijson 初探](https://www.cnblogs.com/x3d/p/apijson-lowcode.html)
+
+[APIJSON使用介绍](http://api.flyrise.cn:9099/docs/open-docs//1459)
+
+[MassCMS With APIJSON最佳实践](https://zhuanlan.zhihu.com/p/655826966)
+
+[APIJSON语法使用,超详细](https://blog.csdn.net/qq_36565607/article/details/139167040)
+
+[wend看源码-ORM-APIJSON](https://itwend.blog.csdn.net/article/details/143980281)
+
+[APIJSON – The No-Code API Revolution That Puts Developers in the Fast Lane](https://medevel.com/apijson)
+
+[APIJSON:17.4k Star!腾讯开源的零代码接口与文档协议及ORM库](https://mp.weixin.qq.com/s/gr84DmWKs4O6lcoT-iaV5w)
+
+[APIJSON腾讯开源的后端开发神器!!!](https://cloud.tencent.com/developer/article/2372220)
+
+[apijson 快速上手](https://blog.csdn.net/qq_16381291/article/details/147110737)
+
+[APIJSON快速入门-零后端代码,接口所见即所得](https://www.toutiao.com/article/7503844050689376783)
+
+[腾讯开源!零代码,全自动万能API接口](https://mp.weixin.qq.com/s/WWndAa68BqBfflWgL5592A)
+
+[APIJSON项目实战教程:零代码实现高效JSON接口开发](https://blog.csdn.net/gitblog_00682/article/details/148375065)
+
+[springboot整合APIJSON——零代码万能通用 API(附源码)](https://blog.csdn.net/longzhutengyue/article/details/150579233)
+
+[APIJSON:重新定义后端开发体验的零代码ORM框架](https://blog.csdn.net/gitblog_01177/article/details/155216163)
+
+[API自动生成这么爽?实测腾讯APIJSON,零代码就能玩转后端接口!](https://mp.weixin.qq.com/s/DmMIGHHcZ783KobGecMxGg)
+
+[腾讯开源的 APIJSON:后端接口不用写了?](https://mp.weixin.qq.com/s/zhkfG4AQEsg0N87lhStwvw)
+
+### 生态项目
+[APIJSON-Demo](https://github.com/APIJSON/APIJSON-Demo) APIJSON 各种语言、各种框架 的 使用示例项目、上手文档、测试数据 SQL 文件 等
+
+[apijson-orm](https://github.com/APIJSON/apijson-orm) APIJSON ORM 库,可通过 Maven, Gradle 等远程依赖
+
+[apijson-framework](https://github.com/APIJSON/apijson-framework) APIJSON 服务端框架,通过数据库表配置角色权限、参数校验等,简化使用
+
+[apijson-router](https://github.com/APIJSON/apijson-router) APIJSON 的路由插件,可控地对公网暴露类 RESTful 简单接口,内部转成 APIJSON 格式请求来执行
+
+[apijson-column](https://github.com/APIJSON/apijson-column) APIJSON 的字段插件,支持 字段名映射 和 !key 反选字段
+
+[apijson-jackson](https://github.com/APIJSON/apijson-jackson) APIJSON 的 jackson 插件,简化使用
+
+[apijson-fastjson2](https://github.com/APIJSON/apijson-fastjson2) APIJSON 的 fastjson2 插件,简化使用
+
+[apijson-gson](https://github.com/APIJSON/apijson-gson) APIJSON 的 gson 插件,简化使用
+
+[apijson-milvus](https://github.com/APIJSON/apijson-milvus) APIJSON 的 Milvus AI 向量数据库插件
+
+[apijson-influxdb](https://github.com/APIJSON/apijson-influxdb) APIJSON 的 InfluxDB 物联网时序数据库插件
+
+[apijson-mongodb](https://github.com/APIJSON/apijson-mongodb) APIJSON 的 MongoDB NoSQL 数据库插件
+
+[apijson-cassandra](https://github.com/APIJSON/apijson-cassandra) APIJSON 的 Cassandra NoSQL 数据库插件
+
+[APIAuto](https://github.com/TommyLemon/APIAuto) ☔ 敏捷开发最强大易用的接口工具,零代码测试与 AI 问答、生成代码与静态检查、生成文档与光标悬浮注释,腾讯、SHEIN、传音 等使用
+
+[CVAuto](https://github.com/TommyLemon/CVAuto) 👁 零代码零标注 CV AI 自动化测试平台 🚀 免除大量人工画框和打标签等,直接快速测试 CV 计算机视觉 AI 图像识别算法
+
+[UnitAuto](https://github.com/TommyLemon/UnitAuto) 最先进、最省事、ROI 最高的单元测试,机器学习 零代码、全方位、自动化 测试 方法/函数,用户包含腾讯、快手、某 500 强巨头等
+
+[SQLAuto](https://github.com/TommyLemon/SQLAuto) 智能零代码自动化测试 SQL 数据库工具,任意增删改查、任意 SQL 模板变量、一键批量生成参数组合、快速构造大量测试数据
+
+[UIGO](https://github.com/TommyLemon/UIGO) 📱 零代码快准稳 UI 智能录制回放平台 🚀 3 像素内自动精准定位,2 毫秒内自动精准等待,用户包含腾讯,微信团队邀请分享
+
+[apijson-doc](https://github.com/vincentCheng/apijson-doc) APIJSON 官方文档,提供排版清晰、搜索方便的文档内容展示,包括设计规范、图文教程等
+
+[APIJSONdocs](https://github.com/ruoranw/APIJSONdocs) APIJSON 英文文档,提供排版清晰的文档内容展示,包括详细介绍、设计规范、使用方式等
+
+[apijson.org](https://github.com/APIJSON/apijson.org) APIJSON 官方网站,提供 APIJSON 的 功能简介、登记用户、作者与贡献者、相关链接 等
+
+[APIJSON.NET](https://github.com/liaozb/APIJSON.NET) C# 版 APIJSON ,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite
+
+[apijson-go](https://github.com/glennliao/apijson-go) Go 版 APIJSON , 基于Go(>=1.18) + GoFrame2, 支持查询、单表增删改、权限管理等
+
+[apijson-go](https://gitee.com/tiangao/apijson-go) Go 版 APIJSON ,支持单表查询、数组查询、多表一对一关联查询、多表一对多关联查询 等
+
+[apijson-hyperf](https://github.com/kvnZero/hyperf-APIJSON.git) PHP 版 APIJSON,基于 Hyperf 支持 MySQL
+
+[APIJSON-php](https://github.com/xianglong111/APIJSON-php) PHP 版 APIJSON,基于 ThinkPHP,支持 MySQL, PostgreSQL, SQL Server, Oracle 等
+
+[apijson-php](https://github.com/qq547057827/apijson-php) PHP 版 APIJSON,基于 ThinkPHP,支持 MySQL, PostgreSQL, SQL Server, Oracle 等
+
+[apijson-node](https://github.com/kevinaskin/apijson-node) 字节跳动工程师开源的 Node.ts 版 APIJSON,提供 nestjs 和 typeorm 的 Demo 及后台管理
+
+[uliweb-apijson](https://github.com/zhangchunlin/uliweb-apijson) Python 版 APIJSON,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite 等
+
+[apijson-rust](https://gitee.com/APIJSON/panda-base) APIJSON 的 Rust 版,一个优雅、高性能的 Rust 多数据源管理系统,支持 MySQL 和 PostgreSQL
+
+[APIJSONParser](https://github.com/Zerounary/APIJSONParser) 第三方 APIJSON 解析器,将 JSON 动态解析成 SQL
+
+[FfApiJson](https://gitee.com/own_3_0/ff-api-json) 用 JSON 格式直接生成 SQL,借鉴 APIJSON 支持多数据源
+
+[APIJSON-ToDo-Demo](https://github.com/jerrylususu/apijson_todo_demo) 一个简单的 todo 示例项目,精简数据,简化上手流程,带自定义鉴权逻辑
+
+[apijson-learn](https://github.com/rainboy-learn/apijson-learn) APIJSON 学习笔记和源码解析
+
+[apijson-practice](https://github.com/vcoolwind/apijson-practice) BAT 技术专家开源的 APIJSON 参数校验注解 Library 及相关 Demo
+
+[apijson-db2](https://github.com/andream7/apijson-db2) 微软工程师接入 IBM 数据库 DB2 的 APIJSON 使用 Demo
+
+[APIJSONDemo](https://github.com/qiujunlin/APIJSONDemo) 字节跳动工程师接入 ClickHouse 的 APIJSON 使用 Demo
+
+[APIJSONDemo_ClickHouse](https://github.com/chenyanlann/APIJSONDemo_ClickHouse) APIJSON + SpringBoot 连接 ClickHouse 使用的 Demo
+
+[APIJSONBoot_Hive](https://github.com/chenyanlann/APIJSONBoot_Hive) APIJSON + SpringBoot 连接 Hive 使用的 Demo
+
+[apijson-sample](https://gitee.com/greyzeng/apijson-sample) APIJSON 简单使用 Demo 及教程
+
+[apijson-examples](https://gitee.com/drone/apijson-examples) APIJSON 的前端、业务后端、管理后端 Demo
+
+[apijson-ruoyi](https://github.com/daodol/apijson-ruoyi) APIJSON 和 RuoYi 框架整合,实现零代码生成页面模板接口,在线维护 APIJSON 数据库配置等
+
+[light4j](https://github.com/xlongwei/light4j) 整合 APIJSON 和微服务框架 light-4j 的 Demo,同时接入了 Redis
+
+[SpringServer1.2-APIJSON](https://github.com/Airforce-1/SpringServer1.2-APIJSON) 智慧党建服务器端,提供 上传 和 下载 文件的接口
+
+[apijson_template](https://github.com/abliger/apijson_template) APIJSON Java 模版,使用 gradle 管理依赖和构建应用
+
+[api-json-demo](https://gitee.com/hxdwd/api-json-demo) 基于 APIJSON,实现低代码写 CURD 代码,代替传统 ORM 框架,适配 Oracle 事务
+
+[ApiJsonByJFinal](https://gitee.com/zhiyuexin/ApiJsonByJFinal) 整合 APIJSON 和 JFinal 的 Demo
+
+[apijson-go-demo](https://github.com/glennliao/apijson-go-demo) apijson-go demos,提供 3 个从简单到复杂的不同场景 Demo
+
+[apijson-builder](https://github.com/pengxianggui/apijson-builder) 一个方便为 APIJSON 构建 RESTful 请求的 JavaScript 库
+
+[apijson-go-ui](https://github.com/glennliao/apijson-go-ui) apijson-go UI 界面配置, 支持权限管理、请求规则配置等
+
+[AbsGrade](https://github.com/APIJSON/AbsGrade) 列表级联算法,支持微信朋友圈单层评论、QQ空间双层评论、百度网盘多层(无限层)文件夹等
+
+[APIJSON-Android-RxJava](https://github.com/TommyLemon/APIJSON-Android-RxJava) 仿微信朋友圈动态实战项目,ZBLibrary(UI) + APIJSON(HTTP) + RxJava(Data)
+
+[Android-ZBLibrary](https://github.com/TommyLemon/Android-ZBLibrary) Android MVP 快速开发框架,Demo 全面,注释详细,使用简单,代码严谨
+
+[apijson-dynamic-datasource](https://github.com/wb04307201/apijson-dynamic-datasource) 基于APIJSON,动态切换数据源、同一数据源批量操作事务一致性DEMO
+
+[xyerp](https://gitee.com/yinjg1997/xyerp) 基于ApiJson的低代码ERP
+
+[quick-boot](https://github.com/csx-bill/quick-boot) 基于 Spring Cloud 2022、Spring Boot 3、AMIS 和 APIJSON 的低代码系统。
+
+[apijson-query-spring-boot-starter](https://gitee.com/mingbaobaba/apijson-query-spring-boot-starter) 一个快速构建 APIJSON 查询条件的插件
+
+[apijson-builder](https://github.com/yeli19950109/apijson-builder) 简单包装 APIJSON,相比直接构造查询 JSON 更好记,ts 编写,调整了一些参数和使用方式
+
+[lanmuc](https://gitee.com/element-admin/lanmuc) 后端低代码生产接口的平台,兼容配置式接口和编写式接口,可做到快速生产接口,上线项目
+
+[review_plan](https://gitee.com/PPXcodeTry/review_plan) 复习提醒Web版(Java技术练习项目)
+
+[apijson-nutz](https://github.com/vincent109/apijson-nutz) APIJSON + Nutz 框架 + NutzBoot 的 Demo
+
+[apijson-spring-boot](https://gitee.com/yunjiao-source/apijson-spring-boot) Springboot3 for APIJSON,用 YAML 简化代码配置
+
+感谢热心的作者们的贡献,点 ⭐Star 支持下他们吧~
+
+
+### 腾讯犀牛鸟开源人才培养计划
+https://github.com/Tencent/APIJSON/issues/229
+
+
+#### qiujunlin **2.接入 presto/hive/clickhouse/db2 任意一个**
+
+APIJSON 接入 clickhouse 使用demo
+https://github.com/qiujunlin/APIJSONDemo
+
+#### zhangshukun 2.接入 presto/hive/clickhouse/db2 任意一个
+APIJSON-Demo接入db2
+https://github.com/andream7/apijson-db2
+
+#### hanxu 1.完善入门介绍视频
+重构 APIJSON 文档
+https://hanxu2018.github.io/APIJSON-DOC/
+文档源码
+https://github.com/HANXU2018/APIJSON-DOC
+配套评论区 apijson-doc-Comment
+https://github.com/HANXU2018/apijson-doc-Comment
+
+#### chenyanlan 2.接入 presto/hive/clickhouse/db2 任意一个
+APIJSON + SpringBoot连接ClickHouse使用的Demo
+https://github.com/chenyanlann/APIJSONDemo_ClickHouse
+
+#### zhaoqiming 1.完善入门介绍视频
+APIJSON 后端教程(1):简介
+https://www.bilibili.com/video/BV1vL411W7yd
+
+APIJSON 后端教程(2):数据库
+https://www.bilibili.com/video/BV1eB4y1N77s
+
+APIJSON 后端教程(3):Demo
+https://www.bilibili.com/video/BV1FX4y1c7ug
+
+APIJSON 后端教程(4):Boot
+https://www.bilibili.com/video/BV18h411z7FK
+
+APIJSON 后端教程(5):Final
+https://www.bilibili.com/video/BV1GM4y1N7XJ
+
+APIJSON 后端教程(6):uliweb_apijson
+https://www.bilibili.com/video/BV1yb4y1S79v/
+
+APIJSON 后端教程(7):问题答疑
+https://www.bilibili.com/video/BV1dQ4y1h7Df
+
+APIJSON配套文档:
+https://github.com/kenlig/apijsondocs
+
+#### huwen 2.接入 presto/hive/clickhouse/db2 任意一个
+APIJSON-Demo 接入presto
+https://github.com/hclown9804/APIJSONDemo_presto
+
+#### zhanghaoling 1.完善入门介绍视频
+APIJSON结合已有项目,简化开发流程
+https://github.com/haolingzhang1/APIJson--demo
+
+说明文档
+https://github.com/haolingzhang1/APIJson--demo/tree/main/APIJson集成项目说明
+
+(1)官方demo
+https://github.com/haolingzhang1/APIJson--demo/blob/main/APIJson集成项目说明/APIJson集成现有项目(1)-%20官方demo.pdf
+
+(2)单表配置
+https://github.com/haolingzhang1/APIJson--demo/blob/main/APIJson集成项目说明/APIJson集成现有项目(2)-%20单表配置.pdf
+
+#### zhoukaile 1.完善入门介绍视频
+
+视频链接:https://www.bilibili.com/video/BV1Uh411z7kZ/
+
+文档链接:https://gitee.com/funkiz/apijson_camp
+
+#### lintao 1.完善入门介绍视频
+
+APIJSON 上手教程:https://www.bilibili.com/video/BV1Pq4y1n7rJ
+
+### 持续更新
+
+https://github.com/Tencent/APIJSON/commits/master
+
+### 工蜂主页
+https://git.code.tencent.com/Tencent_Open_Source/APIJSON
+
+### 码云主页
+https://gitee.com/Tencent/APIJSON
diff --git a/README-English.md b/README-English.md
deleted file mode 100644
index ccafb985..00000000
--- a/README-English.md
+++ /dev/null
@@ -1,393 +0,0 @@
-Tencent is pleased to support the open source community by making APIJSON available.
-Copyright (C) 2020 Tencent. All rights reserved.
-This source code is licensed under the Apache License Version 2.0
-
-
- APIJSON
-
-
-
-
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## 1. About
-
-APIJSON is a JSON based internet communication protocol and an ORM library
-
-
-
-
-
-that largely simplifies the process of back-end API development.
-It also allows users to get data more quickly with self-defined form and fewer endpoints requests.
-
-### Features:
-#### For getting data:
-You can get any data by defining the specific information you want and send it to the server.
-You can get different types of data by making just one request to the server.
-It's very convenient and flexible, and dosen't require different API endpoints with multiple requests.
-It provides CRUD(read and write), Fuzzy Search, Remote Function Calls, etc.
-You can also save duplicate data, see request history, etc.
-
-#### For API design:
-APIJSON largely reduces API developers' workload by reducing most api design and documentation work.
-With APIJSON, client developers will no longer be suffered from possible errors in documents,
-and it saves communication between server developers and client developers about APIs or documentations.
-Server developers no longer need to worry about compatibility of APIs and documents with legacy apps.
-
-
-#### Song Firework-Katy Parry(Modified for APIJSON)
-Do you ever feel like a backend slave
-Repeating CRUD, wanting to make a change?
-Do you ever feel, APIs' so paper thin
-Like a house of cards, one blow from cavin' in?
-Do you ever feel they always complain?
-Urging doc and feedback bugs, even ask your refactoring
-Do you know that there's still a chance for you?
-'Cause there's a powerful tool
-You just gotta depend and configure
-And let it init
-Just start APIs
-They are so easy to try
-'Cause baby, you're a firework
-Come on, show 'em what you're worth
-Make 'em go, "Oh, oh, oh"
-As you give 'em an A-T-M
-Baby, you're a firework
-Come on, let them serve themselves
-Make 'em go, "Oh, oh, oh"
-You're gonna leave 'em all in awe, awe, awe.
-
-
-
-**Tired with endless arguments about HTTP API dev or use?**
-**Use APIJSON-the ORM for providing infinity codeless CRUD APIs that fit almost all your needs.**
-**Unfold the Power(In Your Soul) with ⭐Star & Clone.**
-
-### APIJSON Show
-#### Postman test APIJSON
-
-
-
-#### APIAuto test APIJSON
-Note: The UI is APIAuto, the URL+JSON is APIJSON
-
-
-
-
-
-2.Backend usage
-You can skip this step and use 'apijson.cn:8080'.
-See https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/README-English.md
-
-
-
-## 3. Frontend usage
-You can skip this step and use [APIAuto](https://github.com/TommyLemon/APIAuto) or download App.
-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)
-
-### Download App
-
-Simple demo App for testing APIJSON
-[APIJSONTest.apk](http://files.cnblogs.com/files/tommylemon/APIJSONTest.apk)
-
-Complex production App like Twitter tweets
-[APIJSONApp.apk](http://files.cnblogs.com/files/tommylemon/APIJSONApp.apk)
-
-
-
-## 4. Contributing
-
-We are always looking for more developers to help implementing new features, fix bugs, etc.
-Please have a look at the [open issues](https://github.com/Tencent/APIJSON/issues) before opening a new one.
-
-Fork the project and send a pull request.
-
-Please also ⭐Star the project!
-
-
-## 5. Releases
-
-See the latest release [here](https://github.com/Tencent/APIJSON/releases/tag/5.2.0).
-
-
-
-## 6. Author
-
-Check out the author's [github account](https://github.com/TommyLemon) to see more related projects.
-
-
-If you have any questions or suggestions, you can [create an issue](https://github.com/Tencent/APIJSON/issues) or [send me an e-mail](mailto:tommylemon@qq.com).
-
-
-
-
-### Users of APIJSON:
-
-https://github.com/Tencent/APIJSON/issues/187
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[More APIJSON Users](https://github.com/Tencent/APIJSON/issues/73)
-
-### Contributers of APIJSON:
-Contributers for the APIJSON core project(6 Tencent engineers, 1 Microsoft engineer, 1 Zhihu architect, 1 Bytedance(TikTok) engineer, 1 NetEase engineer, 1 Zoom engineer, 1 YTO Express engineer, 1 Zhilian engineer, 1 UC student、3 SUSTech students, etc.):
-https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
-
-
-
-Authors of other projects for ecosystem of APIJSON(2 Tencent engineers, 1 BAT(Baidu/Alibaba/Tencent) specialist, 1 Microsoft engineer, 2 Bytedance(TikTok) engineers, 1 Digital China engineer & Apache dubbo2js author, etc.):
-https://github.com/search?o=desc&q=apijson&s=stars&type=Repositories
-https://search.gitee.com/?skin=rec&type=repository&q=apijson&sort=stars_count
-
-
-
-Thanks to all contributers of APIJSON!
-
-
-
-### Statistics
-Hundreds of employees from big famous companies(Tencent, Google, Apple, Microsoft, Amazon, Huawei, Alibaba, Paypal, Meituan, Bytedance(TikTok), IBM, Baidu, JD, NetEase, Kuaishou, Shopee, etc.) starred,
-a lot of employees from big famous companies(Tencent, Huawei, Microsoft, Zoom, etc.) created PR/Issue, thank you all~
-[](https://starchart.cc/Tencent/APIJSON)
-
-
-
-
-
-
diff --git a/README.md b/README.md
index 72e15ba6..ccafb985 100644
--- a/README.md
+++ b/README.md
@@ -6,14 +6,15 @@ This source code is licensed under the Apache License Version 2.0
APIJSON
-
后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
@@ -21,36 +22,22 @@ This source code is licensed under the Apache License Version 2.0
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -60,15 +47,12 @@ This source code is licensed under the Apache License Version 2.0
-
@@ -82,48 +66,77 @@ This source code is licensed under the Apache License Version 2.0
---
-导航目录: 项目简介 [上手使用](#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B) [社区生态](#%E6%8A%80%E6%9C%AF%E4%BA%A4%E6%B5%81) 完整详细的导航目录 [点这里查看](/Navigation.md)
+#### A better online document is available at https://apijsondocs.readthedocs.io/
+* ### [1.About](#1)
+* ### [2.Backend usage](#2)
+* ### [3.Frontend usage](#3)
+* ### [4.Contributing](#4)
+* ### [5.Releases](#5)
+* ### [6.Author](#6)
+* ### [7.Donating](#7)
-APIJSON 是一种专为 API 而生的 JSON 网络传输协议 以及 基于这套协议实现的 ORM 库。
-为各种增删改查提供了完全自动化的万能通用接口,零代码实时满足千变万化的各种新增和变更需求。
-能大幅降低开发和沟通成本,简化开发流程,缩短开发周期。
-适合中小型前后端分离的项目,尤其是 创业项目、内部项目、低代码/零代码、小程序、BaaS、Serverless 等。
-
-通过万能通用接口,前端可以定制任何数据、任何结构。
-大部分 HTTP 请求后端再也不用写接口了,更不用写文档了。
-前端再也不用和后端沟通接口或文档问题了。再也不会被文档各种错误坑了。
-后端再也不用为了兼容旧接口写新版接口和文档了。再也不会被前端随时随地没完没了地烦了。
-
-### 特点功能
+
-#### 对于后端
-* 提供万能通用接口,大部分 HTTP API 不用再写
-* 零代码增删改查、各种跨库连表、JOIN 嵌套子查询等
-* 自动生成文档,不用再编写和维护,且自动静态检查
-* 自动校验权限、自动管理版本、自动防 SQL 注入
-* 开放 HTTP API 无需划分版本,始终保持兼容
+## 1. About
+
+APIJSON is a JSON based internet communication protocol and an ORM library
+that largely simplifies the process of back-end API development.
+It also allows users to get data more quickly with self-defined form and fewer endpoints requests.
+
+### Features:
+#### For getting data:
+You can get any data by defining the specific information you want and send it to the server.
+You can get different types of data by making just one request to the server.
+It's very convenient and flexible, and dosen't require different API endpoints with multiple requests.
+It provides CRUD(read and write), Fuzzy Search, Remote Function Calls, etc.
+You can also save duplicate data, see request history, etc.
+
+#### For API design:
+APIJSON largely reduces API developers' workload by reducing most api design and documentation work.
+With APIJSON, client developers will no longer be suffered from possible errors in documents,
+and it saves communication between server developers and client developers about APIs or documentations.
+Server developers no longer need to worry about compatibility of APIs and documents with legacy apps.
+
+
+#### Song Firework-Katy Parry(Modified for APIJSON)
+Do you ever feel like a backend slave
+Repeating CRUD, wanting to make a change?
+Do you ever feel, APIs' so paper thin
+Like a house of cards, one blow from cavin' in?
+Do you ever feel they always complain?
+Urging doc and feedback bugs, even ask your refactoring
+Do you know that there's still a chance for you?
+'Cause there's a powerful tool
+You just gotta depend and configure
+And let it init
+Just start APIs
+They are so easy to try
+'Cause baby, you're a firework
+Come on, show 'em what you're worth
+Make 'em go, "Oh, oh, oh"
+As you give 'em an A-T-M
+Baby, you're a firework
+Come on, let them serve themselves
+Make 'em go, "Oh, oh, oh"
+You're gonna leave 'em all in awe, awe, awe.
-#### 对于前端
-* 不用再向后端催接口、求文档
-* 数据和结构完全定制,要啥有啥
-* 看请求知结果,所求即所得
-* 可一次获取任何数据、任何结构
-* 能去除多余数据,节省流量提高速度
+
-
+**Tired with endless arguments about HTTP API dev or use?**
+**Use APIJSON-the ORM for providing infinity codeless CRUD APIs that fit almost all your needs.**
+**Unfold the Power(In Your Soul) with ⭐Star & Clone.**
-### APIJSON 接口展示
-#### Postman 展示 APIJSON
+### APIJSON Show
+#### Postman test APIJSON

-#### APIAuto 展示 APIJSON
-**使用 APIAuto-机器学习接口工具 来管理和测试 HTTP API 可大幅 减少传参错误、提升联调效率**
-(注意网页工具界面是 APIAuto,里面的 URL+JSON 才是 APIJSON 的 HTTP API):
+#### APIAuto test APIJSON
+Note: The UI is APIAuto, the URL+JSON is APIJSON
+## 2.Backend usage
+You can skip this step and use 'apijson.cn:8080'.
+See https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/README-English.md
-### APIJSON App 演示
-使用 APIJSON + ZBLibrary 开发的 Android 客户端 Demo (以下 Gif 图看起来比较卡,实际上运行很流畅):
-
-
-
-
-
-
-### APIJSON 分享演讲
-#### APIJSON-零代码接口与文档 ORM 库(国际开源谷 Gitee Meetup)
-https://www.bilibili.com/video/BV1Tv411t74v
+## 3. Frontend usage
+You can skip this step and use [APIAuto](https://github.com/TommyLemon/APIAuto) or download App.
+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)
-
-
-
-#### APIJSON 和 APIAuto-零代码开发和测试(QECon 全球软件质量&效能大会)
-
-https://www.bilibili.com/video/BV1yv411p7Y4
-
-
+### Download App
+Simple demo App for testing APIJSON
+[APIJSONTest.apk](http://files.cnblogs.com/files/tommylemon/APIJSONTest.apk)
+
+Complex production App like Twitter tweets
+[APIJSONApp.apk](http://files.cnblogs.com/files/tommylemon/APIJSONApp.apk)
+
+## 4. Contributing
+
+We are always looking for more developers to help implementing new features, fix bugs, etc.
+Please have a look at the [open issues](https://github.com/Tencent/APIJSON/issues) before opening a new one.
-### 为什么选择 APIJSON?
-前后端 关于接口的 开发、文档、联调 等 10 大痛点解析
-https://github.com/Tencent/APIJSON/wiki
-
-* **解决十大痛点** (可帮前后端开发大幅提振开发效率、强力杜绝联调扯皮、巧妙规避文档缺陷、非常节省流量带宽)
-* **开发提速很大** (CRUD 零代码热更新全自动,APIJSONBoot 对比 SSM、SSH 等保守估计可提速 20 倍以上)
-* **腾讯官方开源** (使用 GitHub、Gitee、工蜂 等平台的官方账号开源,微信公众号、腾讯云+社区 等官方公告)
-* **社区影响力大** (GitHub 18K+ Star 在 400W Java 项目排名前 100,远超 FLAG, BAT 等国内外绝大部分开源项目)
-* **各项荣誉成就** (腾讯内外 5 个奖项、腾讯开源前五、腾讯后端 Star 第一、Trending 日周月榜大满贯 等)
-* **多样用户案例** (腾讯内有互娱、音乐、微信、云与智慧,外部有华为、华能、百度、快手、中兴、圆通、传音等)
-* **适用场景广泛** (社交聊天、阅读资讯、影音娱乐、办公学习 等各种 App、网站、小程序、公众号 等非金融类项目)
-* **周边生态丰富** (Android, iOS, Web 等各种 Demo、继承 JSON 的海量生态、零代码 接口测试 和 单元测试 工具等)
-* **文档视频齐全** (项目介绍、快速上手、安装部署 等后端、前端、客户端的 图文解说、视频教程、代码注释 等)
-* **功能丰富强大** (增删改查、分页排序、分组聚合、各种条件、各种 JOIN、各种子查询、跨库连表 等零代码实现)
-* **使用安全简单** (自动增删改查、自动生成文档、自动管理版本、自动控制权限、自动校验参数、自动防 SQL 注入)
-* **灵活定制业务** (在后端编写 远程函数,可以拿到 session、version、当前 JSON 对象 等,然后自定义处理)
-* **高质可靠代码** (代码严谨规范,蚂蚁集团源伞 Pinpoint 代码扫描分析报告平均每行代码 Bug 率低至 0.15%)
-* **兼容各种项目** (协议不限 HTTP,与其它库无冲突,对各类 Web 框架集成友好且提供 SpringBoot, JFinal 的示例)
-* **工程轻量小巧** (无第三方依赖,Jar 仅 263KB,Java 文件仅 68 个共 14864 行代码,例如 APIJSONORM 8.1.0)
-* **多年持续迭代** (自 2016 年起已连续维护 8 年多,70+ 贡献者、100+ 发版、3000+ 提交,不断更新迭代中...)
-
-**按照一般互联网中小型项目情况可得出以下对比表格:**
-
-表数量 T | 平均每表字段数 C | SSMH 按快估计 | APIJSONBoot 按慢估计 | APIJSONBoot 提速倍数
--------- | --------- | --------------------- | ------------------ | -----------
-1 | 3 | 179 min(约一上午) | 11 min(约十分钟) | 15.27
-5 | 4 | 1935 min(约朝九晚六一周) | 70 min(约一小时) | 26.64
-10 | 10 | 8550 min(大小周超半个月) | 320 min(约一下午) | 25.72
-20 | 15 | 31900 min(约 996 两个月) | 940 min(约上班两天) | 32.94
-50 | 20 | 176750 min(11117 超半年) | 3100 min(约上班一周) | 56.02
-
-### 用户反馈
-**腾讯 IEG 数据产品开发组负责人 xinlin:**
-“腾讯的 APIJSON 开源方案,它可以做到零代码生成接口和文档,并且整个生成过程是自动化。当企业有元数据的时候,马上就可以获得接口”
-
-**腾讯科技 后台开发高级工程师 雷大锤:**
-“可以抽出时间来看apijson了,这个可以为T10做准备,也是业界很火的东西,可以提升个人影响力!”
-
-**腾讯 bodian520:**
-“在调试GET、POST、PUT接口时遇到了一些问题,把个人的摸索经验分享一下,希望作者能梳理下文档,方便我们更好的接入”
-
-**华为 minshiwu:**
-“demo工程,默认使用apijson-framework,可以做到无任何配置即可体验apijson的各种能力。”
-
-**字节跳动 qiujunlin:**
-“初次见到这个项目,觉得太惊艳了,眼前一亮。给我的感受是,项目大大简化了开发流程,开发效率提升了很多倍。”
-
-**百度智慧城市研发 lpeng:**
-“很兴奋的发现APIJSON很适合我们的一个开发场景,作为我们协议定义的一部分”
-
-**中兴 duyijiang:**
-“感谢腾讯大大提供的框架,很好用”
-
-https://github.com/Tencent/APIJSON/issues/132#issuecomment-1106669540
+Fork the project and send a pull request.
+Please also ⭐Star the project!
-### 常见问题
-#### 1.如何定制业务逻辑?
-在后端编写 远程函数,可以拿到 session、version、当前 JSON 对象、参数名称 等,然后对查到的数据自定义处理
-https://github.com/Tencent/APIJSON/issues/101
+## 5. Releases
+
+See the latest release [here](https://github.com/Tencent/APIJSON/releases/tag/5.2.0).
-#### 2.如何控制权限?
-在 Access 表配置校验规则,默认不允许访问,需要对 每张表、每种角色、每种操作 做相应的配置,粒度细分到行级
-https://github.com/Tencent/APIJSON/issues/12
+
-#### 3.如何校验参数?
-在 Request 表配置校验规则 structure,提供 MUST、TYPE、VERIFY 等通用方法,可通过 远程函数 来完全自定义
-https://github.com/Tencent/APIJSON/wiki#%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86
+## 6. Author
+
+Check out the author's [github account](https://github.com/TommyLemon) to see more related projects.
+
-更多常见问题及提问前必看
-https://github.com/Tencent/APIJSON/issues/36
-
+If you have any questions or suggestions, you can [create an issue](https://github.com/Tencent/APIJSON/issues) or [send me an e-mail](mailto:tommylemon@qq.com).
-### 注意事项
-**请求参数 JSON 中表名、字段名、关键词及对应的值都是大小写敏感、逗号敏感、分号敏感、空格敏感、换行敏感,
-大部分情况都不允许空格和换行,表名以大写字母开头,不要想当然,请严格按照 [设计规范](https://github.com/Tencent/APIJSON/blob/master/Document.md#3) 来调用 API !**
-[#181](https://github.com/Tencent/APIJSON/issues/181)
-
-
-
-导航目录: [项目简介](#--apijson) 上手使用 [社区生态](#%E6%8A%80%E6%9C%AF%E4%BA%A4%E6%B5%81) 完整详细的导航目录 [点这里查看](/Navigation.md)
-### 快速上手
+### Users of APIJSON:
-#### 1.后端上手
-可以跳过这个步骤,直接用APIJSON服务器IP地址 apijson.cn:8080 来测试接口。
-见 [APIJSON后端上手 - Java](https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server)
-
-#### 2.前端上手
-可以跳过这个步骤,直接使用 [APIAuto-机器学习HTTP接口工具](https://github.com/TommyLemon/APIAuto) 或 下载客户端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)
-
-
-### 下载客户端 App
-
-仿微信朋友圈动态实战项目
-[APIJSONApp.apk](http://files.cnblogs.com/files/tommylemon/APIJSONApp.apk)
-
-测试及自动生成代码工具
-[APIJSONTest.apk](http://files.cnblogs.com/files/tommylemon/APIJSONTest.apk)
-
-### 开源许可
-使用 [Apache License 2.0](/LICENSE),对 公司、团队、个人 等 商用、非商用 都自由免费且非常友好,请放心使用和登记
-
-### 使用登记
-如果您在使用 APIJSON,请让我们知道,您的使用对我们非常重要(新的按登记顺序排列、专群优先答疑解惑):
https://github.com/Tencent/APIJSON/issues/187
@@ -353,28 +277,13 @@ https://github.com/Tencent/APIJSON/issues/187
-
+
-
- * [腾讯科技有限公司](https://www.tencent.com)
- * [腾讯音乐娱乐集团](https://www.tencentmusic.com)
- * [深圳市传音通讯有限公司](https://www.transsion.com)
- * [社宝信息科技(上海)有限公司](https://shebaochina.com)
- * [华能贵诚信托有限公司](https://www.hngtrust.com)
- * [投投科技](https://www.toutou.com.cn)
- * [圆通速递](https://www.yto.net.cn)
- * [乐拼科技](https://www.lepinyongche.com)
- * [珠海采筑电子商务有限公司](https://www.aupup.com)
- * [爱投斯智能技术(深圳)有限公司](http://www.aiotos.net)
- * [邻盛科技(武汉)有限公司](http://www.linksame.com)
- * [上海麦市信息科技有限公司](https://www.masscms.com)
- * [上海翊丞互联网科技有限公司](http://www.renrencjl.com/home)
- * [上海直真君智科技有限公司](http://www.zzjunzhi.com)
- * [北明软件有限公司](https://www.bmsoft.com.cn/)
- * [上海钰亿环保科技有限公司](#)
-
-### 贡献者们
-主项目 APIJSON 的贡献者们(6 个腾讯工程师、1 个微软工程师、1 个阿里云工程师、1 个字节跳动工程师、1 个网易工程师、1 个 Zoom 工程师、1 个圆通工程师、1 个知乎基础研发架构师、1 个智联招聘工程师、gorm-plus 作者、1 个美国加州大学学生、3 个 SUSTech 学生等):
+
+[More APIJSON Users](https://github.com/Tencent/APIJSON/issues/73)
+
+### Contributers of APIJSON:
+Contributers for the APIJSON core project(6 Tencent engineers, 1 Microsoft engineer, 1 Zhihu architect, 1 Bytedance(TikTok) engineer, 1 NetEase engineer, 1 Zoom engineer, 1 YTO Express engineer, 1 Zhilian engineer, 1 UC student、3 SUSTech students, etc.):
https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
-
-生态周边项目的作者们(2 个腾讯工程师、1 个 BAT 技术专家、1 个微软工程师、2 个字节跳动工程师、1 个神州数码工程师&Apache dubbo2js 作者 等):
+
+Authors of other projects for ecosystem of APIJSON(2 Tencent engineers, 1 BAT(Baidu/Alibaba/Tencent) specialist, 1 Microsoft engineer, 2 Bytedance(TikTok) engineers, 1 Digital China engineer & Apache dubbo2js author, etc.):
https://github.com/search?o=desc&q=apijson&s=stars&type=Repositories
https://search.gitee.com/?skin=rec&type=repository&q=apijson&sort=stars_count
-
-还有为 APIJSON 扫描代码贡献 Issue 的 [蚂蚁集团源伞](https://www.sourcebrella.com) 和 [奇安信代码卫士](https://github.com/QiAnXinCodeSafe)
-
-
+Thanks to all contributers of APIJSON!
-感谢大家的贡献。
+
-### 统计分析
-腾讯、华为、阿里巴巴、美团、字节跳动、百度、京东、网易、快手等和 Google, Apple, Microsoft, Amazon, Paypal, IBM, Shopee 等
-数百名知名大厂员工点了 Star,也有腾讯、华为、字节跳动、Microsoft、Zoom 等不少知名大厂员工提了 PR/Issue,感谢大家的支持~
+### Statistics
+Hundreds of employees from big famous companies(Tencent, Google, Apple, Microsoft, Amazon, Huawei, Alibaba, Paypal, Meituan, Bytedance(TikTok), IBM, Baidu, JD, NetEase, Kuaishou, Shopee, etc.) starred,
+a lot of employees from big famous companies(Tencent, Huawei, Microsoft, Zoom, etc.) created PR/Issue, thank you all~
[](https://starchart.cc/Tencent/APIJSON)
-根据开源指南针报告,APIJSON Java 版已经是国内顶级、国际一流的 Java 开源项目了 [#518](https://github.com/Tencent/APIJSON/issues/518)
-
-### 规划及路线图
-新增功能、强化安全、提高性能、增强稳定、完善文档、丰富周边、推广使用
-https://github.com/Tencent/APIJSON/blob/master/Roadmap.md
-
-理论上所有支持 SQL 与 JDBC/ODBC 的软件,都可以用本项目对接 CRUD,待测试:
-[OceanBase](https://www.oceanbase.com/docs/oceanbase/V2.2.50/ss-sr-select_daur3l), [Spark](https://spark.apache.org/docs/3.3.0/sql-ref-syntax-qry-select.html)(可用 Hive 对接), [Phoenix](http://phoenix.apache.org/language/index.html#select)(延伸支持 HBase)
-
-### 我要赞赏
-创作不易,坚持更难,右上角点 ⭐Star 来支持/收藏下吧,谢谢 ^_^
-https://github.com/Tencent/APIJSON
-
-
-
-
-导航目录: [项目简介](#--apijson) [上手使用](#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B) 社区生态 完整详细的导航目录 [点这里查看](/Navigation.md)
-
-### 技术交流
-如果有什么问题或建议可以 [填问卷](https://wj.qq.com/s2/10971431/2a09) 或 [提 Issue](https://github.com/Tencent/APIJSON/issues/36),交流技术,分享经验。
-如果你解决了某些 bug,或者新增了一些功能,欢迎 [贡献代码](https://github.com/Tencent/APIJSON/pulls),感激不尽~
-https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
-
-**开发者也是人,也需要工作、休息、恋爱、陪伴家人、走亲会友等,也有心情不好和身体病痛,**
-**往往没有额外的时间精力顾及一些小问题,请理解和支持,开源要大家参与贡献才会更美好~**
-**少数个人的热情终有被耗尽的一天,只有大家共同建设和繁荣社区,才能让开源可持续发展!**
-
-**开发者时间精力有限,原则上优先解决 登记用户 和 贡献者 的问题,**
-**不解决 文档/视频/常见问题 已明确说明、描述简陋 或 态度无礼 的问题!**
-**如果你已经多次得到帮助,却仍然只索取不贡献,那就别指望大家再帮你!**
-**私聊作者请教技术问题 或者 频繁在互助群 @ 作者 可能会被拉黑/禁言/踢群,请尊重和理解,谢谢!**
-
-如果你 [提 PR 登记了自己使用 APIJSON 的公司](https://github.com/Tencent/APIJSON/issues/187),可以加 **企业用户支持专群**,作者亲自且优先答疑,
-作者只有解答完了这个专群里的全部问题,才看情况解答 Issue/问卷 里的问题(对 Issue/问卷 不保证解答、更不保证及时);
-之前的几个互助群,由于大多数问题 在文档/Issue 已有答案却反复提 或者 缺少必要信息要来来回回沟通问清细节 已浪费太多时间,
-甚至有白嫖还把自己当大爷的自私自利伸手党输出情绪,我们不再支持,建议未登记企业的用户 [填问卷](https://wj.qq.com/s2/10971431/2a09) 或 [提 Issue](https://github.com/Tencent/APIJSON/issues/36)。
-
-如果你为 APIJSON 做出了以下任何一个贡献,我们将优先为你答疑解惑:
-[提交了 PR 且被合并](https://github.com/Tencent/APIJSON/pull/92)、[提交了优质 Issue](https://github.com/Tencent/APIJSON/issues/189)、[发表了优质文章](https://blog.csdn.net/qq_41829492/article/details/88670940)、[开发了可用的生态项目](https://github.com/zhangchunlin/uliweb-apijson),
-Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任职企业的用户 > 其他用户。
-
-
-### 相关推荐
-[APIJSON, 接口和文档的终结者!](https://my.oschina.net/tommylemon/blog/805459)
-
-[腾讯业务百万数据 6s 响应,APIJSON 性能优化背后的故事](https://my.oschina.net/tommylemon/blog/5375645)
-
-[仿QQ空间和微信朋友圈,高解耦高复用高灵活](https://my.oschina.net/tommylemon/blog/885787)
-
-[后端开挂:3行代码写出8个接口!](https://my.oschina.net/tommylemon/blog/1574430)
-
-[后端自动化版本管理,再也不用改URL了!](https://my.oschina.net/tommylemon/blog/1576587)
-
-[3步创建APIJSON后端新表及配置](https://my.oschina.net/tommylemon/blog/889074)
-
-[APIJSON对接分布式HTAP数据库TiDB](https://my.oschina.net/tommylemon/blog/3081913)
-
-[APIJSON教程(一):上手apijson项目,学习apijson语法,并实现持久层配置](https://zhuanlan.zhihu.com/p/375681893)
-
-[apijson简单demo](https://blog.csdn.net/dmw412724/article/details/113558115)
-
-[apijson简单使用](https://www.cnblogs.com/greyzeng/p/14311995.html)
-
-[APIJSON简单部署和使用](https://blog.csdn.net/m450744192/article/details/108462611)
-
-[学习自动化接口APIJSON](https://www.jianshu.com/p/981a2a630c7b)
-
-[APIJSON 接口调试实践](https://github.com/Tencent/APIJSON/issues/189)
-
-[APIJSON-零代码接口和文档 JSON 协议 与 ORM 库](https://cloud.tencent.com/developer/article/2077042)
-
-[APIJSON使用例子总结](https://blog.csdn.net/weixin_41077841/article/details/110518007)
-
-[APIJSON 自动化接口和文档的快速开发神器 (一)](https://blog.csdn.net/qq_41829492/article/details/88670940)
-
-[APIJSON在mac电脑环境下配置去连接SQL Server](https://juejin.im/post/5e16d21ef265da3e2e4f4956)
-
-[APIJSON复杂业务深入实践(类似12306订票系统)](https://blog.csdn.net/aa330233789/article/details/105309571)
-
-[新手搭建 APIJSON 项目指北](https://github.com/jerrylususu/apijson_todo_demo/blob/master/FULLTEXT.md)
-
-[使用APIJSON写低代码Crud接口](https://blog.csdn.net/weixin_42375862/article/details/121654264)
-
-[apijson在同一个接口调用中 使用远程函数写入更新时间和创建时间](https://blog.csdn.net/qietingfengsong/article/details/124097229)
-
-[APIJSON(一:综述)](https://blog.csdn.net/qq_50861917/article/details/120556168)
-
-[APIJSON 代码分析(三:demo主体代码)](https://blog.csdn.net/qq_50861917/article/details/120751630)
-
-[APIJSON 代码分析(二)AbstractParser类(解析器)](https://blog.csdn.net/weixin_45767055/article/details/120815927)
-
-[APIJSON 代码分析(四:AbstractObjectParser源码阅读)](https://blog.csdn.net/qq_50861917/article/details/120896381)
-
-[APIJSON 代码分析 AbstractSQLConfig 第二篇](https://blog.csdn.net/csascscascd/article/details/120684889)
-
-[APIJSON 代码分析(六)APIJSON—Verifier检查类](https://blog.csdn.net/weixin_45767055/article/details/121321731)
-
-[APIJSON 代码分析(四)AbstractSQLExecutor—SQL执行器](https://blog.csdn.net/weixin_45767055/article/details/121069887)
-
-[APIJSON使用](https://juejin.cn/post/7148253873478565902)
-
-[apijson 初探](https://www.cnblogs.com/x3d/p/apijson-lowcode.html)
-
-[APIJSON使用介绍](http://api.flyrise.cn:9099/docs/open-docs//1459)
-
-[MassCMS With APIJSON最佳实践](https://zhuanlan.zhihu.com/p/655826966)
-
-[APIJSON语法使用,超详细](https://blog.csdn.net/qq_36565607/article/details/139167040)
-
-[wend看源码-ORM-APIJSON](https://itwend.blog.csdn.net/article/details/143980281)
-
-[APIJSON – The No-Code API Revolution That Puts Developers in the Fast Lane](https://medevel.com/apijson)
-
-[APIJSON:17.4k Star!腾讯开源的零代码接口与文档协议及ORM库](https://mp.weixin.qq.com/s/gr84DmWKs4O6lcoT-iaV5w)
-
-[APIJSON腾讯开源的后端开发神器!!!](https://cloud.tencent.com/developer/article/2372220)
-
-[apijson 快速上手](https://blog.csdn.net/qq_16381291/article/details/147110737)
-
-[APIJSON快速入门-零后端代码,接口所见即所得](https://www.toutiao.com/article/7503844050689376783)
-
-[腾讯开源!零代码,全自动万能API接口](https://mp.weixin.qq.com/s/WWndAa68BqBfflWgL5592A)
-
-[APIJSON项目实战教程:零代码实现高效JSON接口开发](https://blog.csdn.net/gitblog_00682/article/details/148375065)
-
-[springboot整合APIJSON——零代码万能通用 API(附源码)](https://blog.csdn.net/longzhutengyue/article/details/150579233)
-
-[APIJSON:重新定义后端开发体验的零代码ORM框架](https://blog.csdn.net/gitblog_01177/article/details/155216163)
-
-[API自动生成这么爽?实测腾讯APIJSON,零代码就能玩转后端接口!](https://mp.weixin.qq.com/s/DmMIGHHcZ783KobGecMxGg)
-
-[腾讯开源的 APIJSON:后端接口不用写了?](https://mp.weixin.qq.com/s/zhkfG4AQEsg0N87lhStwvw)
-
-### 生态项目
-[APIJSON-Demo](https://github.com/APIJSON/APIJSON-Demo) APIJSON 各种语言、各种框架 的 使用示例项目、上手文档、测试数据 SQL 文件 等
-
-[apijson-orm](https://github.com/APIJSON/apijson-orm) APIJSON ORM 库,可通过 Maven, Gradle 等远程依赖
-
-[apijson-framework](https://github.com/APIJSON/apijson-framework) APIJSON 服务端框架,通过数据库表配置角色权限、参数校验等,简化使用
-
-[apijson-router](https://github.com/APIJSON/apijson-router) APIJSON 的路由插件,可控地对公网暴露类 RESTful 简单接口,内部转成 APIJSON 格式请求来执行
-
-[apijson-column](https://github.com/APIJSON/apijson-column) APIJSON 的字段插件,支持 字段名映射 和 !key 反选字段
-
-[apijson-jackson](https://github.com/APIJSON/apijson-jackson) APIJSON 的 jackson 插件,简化使用
-
-[apijson-fastjson2](https://github.com/APIJSON/apijson-fastjson2) APIJSON 的 fastjson2 插件,简化使用
-
-[apijson-gson](https://github.com/APIJSON/apijson-gson) APIJSON 的 gson 插件,简化使用
-
-[apijson-milvus](https://github.com/APIJSON/apijson-milvus) APIJSON 的 Milvus AI 向量数据库插件
-
-[apijson-influxdb](https://github.com/APIJSON/apijson-influxdb) APIJSON 的 InfluxDB 物联网时序数据库插件
-
-[apijson-mongodb](https://github.com/APIJSON/apijson-mongodb) APIJSON 的 MongoDB NoSQL 数据库插件
-
-[apijson-cassandra](https://github.com/APIJSON/apijson-cassandra) APIJSON 的 Cassandra NoSQL 数据库插件
-
-[APIAuto](https://github.com/TommyLemon/APIAuto) ☔ 敏捷开发最强大易用的接口工具,零代码测试与 AI 问答、生成代码与静态检查、生成文档与光标悬浮注释,腾讯、SHEIN、传音 等使用
-
-[CVAuto](https://github.com/TommyLemon/CVAuto) 👁 零代码零标注 CV AI 自动化测试平台 🚀 免除大量人工画框和打标签等,直接快速测试 CV 计算机视觉 AI 图像识别算法
-
-[UnitAuto](https://github.com/TommyLemon/UnitAuto) 最先进、最省事、ROI 最高的单元测试,机器学习 零代码、全方位、自动化 测试 方法/函数,用户包含腾讯、快手、某 500 强巨头等
-
-[SQLAuto](https://github.com/TommyLemon/SQLAuto) 智能零代码自动化测试 SQL 数据库工具,任意增删改查、任意 SQL 模板变量、一键批量生成参数组合、快速构造大量测试数据
-
-[UIGO](https://github.com/TommyLemon/UIGO) 📱 零代码快准稳 UI 智能录制回放平台 🚀 3 像素内自动精准定位,2 毫秒内自动精准等待,用户包含腾讯,微信团队邀请分享
-
-[apijson-doc](https://github.com/vincentCheng/apijson-doc) APIJSON 官方文档,提供排版清晰、搜索方便的文档内容展示,包括设计规范、图文教程等
-
-[APIJSONdocs](https://github.com/ruoranw/APIJSONdocs) APIJSON 英文文档,提供排版清晰的文档内容展示,包括详细介绍、设计规范、使用方式等
-
-[apijson.org](https://github.com/APIJSON/apijson.org) APIJSON 官方网站,提供 APIJSON 的 功能简介、登记用户、作者与贡献者、相关链接 等
-
-[APIJSON.NET](https://github.com/liaozb/APIJSON.NET) C# 版 APIJSON ,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite
-
-[apijson-go](https://github.com/glennliao/apijson-go) Go 版 APIJSON , 基于Go(>=1.18) + GoFrame2, 支持查询、单表增删改、权限管理等
-
-[apijson-go](https://gitee.com/tiangao/apijson-go) Go 版 APIJSON ,支持单表查询、数组查询、多表一对一关联查询、多表一对多关联查询 等
-
-[apijson-hyperf](https://github.com/kvnZero/hyperf-APIJSON.git) PHP 版 APIJSON,基于 Hyperf 支持 MySQL
-
-[APIJSON-php](https://github.com/xianglong111/APIJSON-php) PHP 版 APIJSON,基于 ThinkPHP,支持 MySQL, PostgreSQL, SQL Server, Oracle 等
-
-[apijson-php](https://github.com/qq547057827/apijson-php) PHP 版 APIJSON,基于 ThinkPHP,支持 MySQL, PostgreSQL, SQL Server, Oracle 等
-
-[apijson-node](https://github.com/kevinaskin/apijson-node) 字节跳动工程师开源的 Node.ts 版 APIJSON,提供 nestjs 和 typeorm 的 Demo 及后台管理
-
-[uliweb-apijson](https://github.com/zhangchunlin/uliweb-apijson) Python 版 APIJSON,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite 等
-
-[apijson-rust](https://gitee.com/APIJSON/panda-base) APIJSON 的 Rust 版,一个优雅、高性能的 Rust 多数据源管理系统,支持 MySQL 和 PostgreSQL
-
-[APIJSONParser](https://github.com/Zerounary/APIJSONParser) 第三方 APIJSON 解析器,将 JSON 动态解析成 SQL
-
-[FfApiJson](https://gitee.com/own_3_0/ff-api-json) 用 JSON 格式直接生成 SQL,借鉴 APIJSON 支持多数据源
-
-[APIJSON-ToDo-Demo](https://github.com/jerrylususu/apijson_todo_demo) 一个简单的 todo 示例项目,精简数据,简化上手流程,带自定义鉴权逻辑
-
-[apijson-learn](https://github.com/rainboy-learn/apijson-learn) APIJSON 学习笔记和源码解析
-
-[apijson-practice](https://github.com/vcoolwind/apijson-practice) BAT 技术专家开源的 APIJSON 参数校验注解 Library 及相关 Demo
-
-[apijson-db2](https://github.com/andream7/apijson-db2) 微软工程师接入 IBM 数据库 DB2 的 APIJSON 使用 Demo
-
-[APIJSONDemo](https://github.com/qiujunlin/APIJSONDemo) 字节跳动工程师接入 ClickHouse 的 APIJSON 使用 Demo
-
-[APIJSONDemo_ClickHouse](https://github.com/chenyanlann/APIJSONDemo_ClickHouse) APIJSON + SpringBoot 连接 ClickHouse 使用的 Demo
-
-[APIJSONBoot_Hive](https://github.com/chenyanlann/APIJSONBoot_Hive) APIJSON + SpringBoot 连接 Hive 使用的 Demo
-
-[apijson-sample](https://gitee.com/greyzeng/apijson-sample) APIJSON 简单使用 Demo 及教程
-
-[apijson-examples](https://gitee.com/drone/apijson-examples) APIJSON 的前端、业务后端、管理后端 Demo
-
-[apijson-ruoyi](https://github.com/daodol/apijson-ruoyi) APIJSON 和 RuoYi 框架整合,实现零代码生成页面模板接口,在线维护 APIJSON 数据库配置等
-
-[light4j](https://github.com/xlongwei/light4j) 整合 APIJSON 和微服务框架 light-4j 的 Demo,同时接入了 Redis
-
-[SpringServer1.2-APIJSON](https://github.com/Airforce-1/SpringServer1.2-APIJSON) 智慧党建服务器端,提供 上传 和 下载 文件的接口
-
-[apijson_template](https://github.com/abliger/apijson_template) APIJSON Java 模版,使用 gradle 管理依赖和构建应用
-
-[api-json-demo](https://gitee.com/hxdwd/api-json-demo) 基于 APIJSON,实现低代码写 CURD 代码,代替传统 ORM 框架,适配 Oracle 事务
-
-[ApiJsonByJFinal](https://gitee.com/zhiyuexin/ApiJsonByJFinal) 整合 APIJSON 和 JFinal 的 Demo
-
-[apijson-go-demo](https://github.com/glennliao/apijson-go-demo) apijson-go demos,提供 3 个从简单到复杂的不同场景 Demo
-
-[apijson-builder](https://github.com/pengxianggui/apijson-builder) 一个方便为 APIJSON 构建 RESTful 请求的 JavaScript 库
-
-[apijson-go-ui](https://github.com/glennliao/apijson-go-ui) apijson-go UI 界面配置, 支持权限管理、请求规则配置等
-
-[AbsGrade](https://github.com/APIJSON/AbsGrade) 列表级联算法,支持微信朋友圈单层评论、QQ空间双层评论、百度网盘多层(无限层)文件夹等
-
-[APIJSON-Android-RxJava](https://github.com/TommyLemon/APIJSON-Android-RxJava) 仿微信朋友圈动态实战项目,ZBLibrary(UI) + APIJSON(HTTP) + RxJava(Data)
-
-[Android-ZBLibrary](https://github.com/TommyLemon/Android-ZBLibrary) Android MVP 快速开发框架,Demo 全面,注释详细,使用简单,代码严谨
-
-[apijson-dynamic-datasource](https://github.com/wb04307201/apijson-dynamic-datasource) 基于APIJSON,动态切换数据源、同一数据源批量操作事务一致性DEMO
-
-[xyerp](https://gitee.com/yinjg1997/xyerp) 基于ApiJson的低代码ERP
-
-[quick-boot](https://github.com/csx-bill/quick-boot) 基于 Spring Cloud 2022、Spring Boot 3、AMIS 和 APIJSON 的低代码系统。
-
-[apijson-query-spring-boot-starter](https://gitee.com/mingbaobaba/apijson-query-spring-boot-starter) 一个快速构建 APIJSON 查询条件的插件
-
-[apijson-builder](https://github.com/yeli19950109/apijson-builder) 简单包装 APIJSON,相比直接构造查询 JSON 更好记,ts 编写,调整了一些参数和使用方式
-
-[lanmuc](https://gitee.com/element-admin/lanmuc) 后端低代码生产接口的平台,兼容配置式接口和编写式接口,可做到快速生产接口,上线项目
-
-[review_plan](https://gitee.com/PPXcodeTry/review_plan) 复习提醒Web版(Java技术练习项目)
-
-[apijson-nutz](https://github.com/vincent109/apijson-nutz) APIJSON + Nutz 框架 + NutzBoot 的 Demo
-
-[apijson-spring-boot](https://gitee.com/yunjiao-source/apijson-spring-boot) Springboot3 for APIJSON,用 YAML 简化代码配置
-
-感谢热心的作者们的贡献,点 ⭐Star 支持下他们吧~
-
-
-### 腾讯犀牛鸟开源人才培养计划
-https://github.com/Tencent/APIJSON/issues/229
-
-
-#### qiujunlin **2.接入 presto/hive/clickhouse/db2 任意一个**
-
-APIJSON 接入 clickhouse 使用demo
-https://github.com/qiujunlin/APIJSONDemo
-
-#### zhangshukun 2.接入 presto/hive/clickhouse/db2 任意一个
-APIJSON-Demo接入db2
-https://github.com/andream7/apijson-db2
-
-#### hanxu 1.完善入门介绍视频
-重构 APIJSON 文档
-https://hanxu2018.github.io/APIJSON-DOC/
-文档源码
-https://github.com/HANXU2018/APIJSON-DOC
-配套评论区 apijson-doc-Comment
-https://github.com/HANXU2018/apijson-doc-Comment
-
-#### chenyanlan 2.接入 presto/hive/clickhouse/db2 任意一个
-APIJSON + SpringBoot连接ClickHouse使用的Demo
-https://github.com/chenyanlann/APIJSONDemo_ClickHouse
-
-#### zhaoqiming 1.完善入门介绍视频
-APIJSON 后端教程(1):简介
-https://www.bilibili.com/video/BV1vL411W7yd
-
-APIJSON 后端教程(2):数据库
-https://www.bilibili.com/video/BV1eB4y1N77s
-
-APIJSON 后端教程(3):Demo
-https://www.bilibili.com/video/BV1FX4y1c7ug
-
-APIJSON 后端教程(4):Boot
-https://www.bilibili.com/video/BV18h411z7FK
-
-APIJSON 后端教程(5):Final
-https://www.bilibili.com/video/BV1GM4y1N7XJ
-
-APIJSON 后端教程(6):uliweb_apijson
-https://www.bilibili.com/video/BV1yb4y1S79v/
-
-APIJSON 后端教程(7):问题答疑
-https://www.bilibili.com/video/BV1dQ4y1h7Df
-
-APIJSON配套文档:
-https://github.com/kenlig/apijsondocs
-
-#### huwen 2.接入 presto/hive/clickhouse/db2 任意一个
-APIJSON-Demo 接入presto
-https://github.com/hclown9804/APIJSONDemo_presto
-
-#### zhanghaoling 1.完善入门介绍视频
-APIJSON结合已有项目,简化开发流程
-https://github.com/haolingzhang1/APIJson--demo
-
-说明文档
-https://github.com/haolingzhang1/APIJson--demo/tree/main/APIJson集成项目说明
-
-(1)官方demo
-https://github.com/haolingzhang1/APIJson--demo/blob/main/APIJson集成项目说明/APIJson集成现有项目(1)-%20官方demo.pdf
-
-(2)单表配置
-https://github.com/haolingzhang1/APIJson--demo/blob/main/APIJson集成项目说明/APIJson集成现有项目(2)-%20单表配置.pdf
-
-#### zhoukaile 1.完善入门介绍视频
-
-视频链接:https://www.bilibili.com/video/BV1Uh411z7kZ/
-
-文档链接:https://gitee.com/funkiz/apijson_camp
-
-#### lintao 1.完善入门介绍视频
-
-APIJSON 上手教程:https://www.bilibili.com/video/BV1Pq4y1n7rJ
-
-### 持续更新
-
-https://github.com/Tencent/APIJSON/commits/master
-
-### 工蜂主页
-https://git.code.tencent.com/Tencent_Open_Source/APIJSON
-
-### 码云主页
-https://gitee.com/Tencent/APIJSON
From 62e1307db5340000d71afceefb70341da12d2340 Mon Sep 17 00:00:00 2001
From: TommyLemon
+
+# APIJSON 通用文档
+本文是通用文档,只和 APIJSON 协议有关,和 C#, Go, Java, JavaScript, PHP, Python, TypeScript 等开发语言无关。
+具体开发语言相关的 配置、运行、部署 等文档见各个相关项目的文档,可以在首页点击对应语言的入口来查看。
+https://github.com/Tencent/APIJSON
+
+
+
+后端开发者可以先看 [图文入门教程1](http://apijson.cn/doc/zh/) 或 [图文入门教程2](https://hanxu2018.github.io/APIJSON-DOC/) (和本文档有出入的点以本文档为准。例如正则匹配 key? 已废弃,用 key~ 替代;例如 "@column":"store_id,sum(amt):totAmt" 中逗号 , 有误,应该用分号 ; 隔开 SQL 函数,改为 "@column":"store_id;sum(amt):totAmt")
+
+* ### [1.示例](#1)
+* ### [2.对比传统方式](#2)
+* [2.1 开发流程](#2.1)
+* [2.2 前端请求](#2.2)
+* [2.3 后端操作](#2.3)
+* [2.4 前端解析](#2.4)
+* [2.5 对应不同需求的请求](#2.5)
+* [2.6 对应不同请求的结果](#2.6)
+* ### [3.设计规范](#3)
+* [3.1 操作方法](#3.1)
+* [3.2 功能符](#3.2)
+
+
+## 1.示例
+
+#### 获取用户
+请求:
+
+
+[点击这里测试](http://apijson.cn:8080/get/{"User":{"id":38710}})
+
+返回:
+{
+ "User":{
+ "id":38710
+ }
+}
+
+
+{
+ "User":{
+ "id":38710,
+ "sex":0,
+ "name":"TommyLemon",
+ "tag":"Android&Java",
+ "head":"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
+ "date":1485948110000,
+ "pictureList":[
+ "http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
+ "http://common.cnblogs.com/images/icon_weibo_24.png"
+ ]
+ },
+ "code":200,
+ "msg":"success"
+}
+
+
+#### 获取用户列表
+请求:
+
+
+[点击这里测试](http://apijson.cn:8080/get/{"[]":{"count":3,"User":{"@column":"id,name"}}})
+
+返回:
+{
+ "[]":{
+ "count":3, //只要3个
+ "User":{
+ "@column":"id,name" //只要id,name这两个字段
+ }
+ }
+}
+
+
+{
+ "[]":[
+ {
+ "User":{
+ "id":38710,
+ "name":"TommyLemon"
+ }
+ },
+ {
+ "User":{
+ "id":70793,
+ "name":"Strong"
+ }
+ },
+ {
+ "User":{
+ "id":82001,
+ "name":"Android"
+ }
+ }
+ ],
+ "code":200,
+ "msg":"success"
+}
+
+
+#### 获取动态及发布者用户
+请求:
+
+
+[点击这里测试](http://apijson.cn:8080/get/{"Moment":{},"User":{"id@":"Moment%252FuserId"}})
+
+返回:
+{
+ "Moment":{
+ },
+ "User":{
+ "id@":"Moment/userId" //User.id = Moment.userId
+ }
+}
+
+
+{
+ "Moment":{
+ "id":12,
+ "userId":70793,
+ "date":"2017-02-08 16:06:11.0",
+ "content":"1111534034"
+ },
+ "User":{
+ "id":70793,
+ "sex":0,
+ "name":"Strong",
+ "tag":"djdj",
+ "head":"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000",
+ "contactIdList":[
+ 38710,
+ 82002
+ ],
+ "date":"2017-02-01 19:21:50.0"
+ },
+ "code":200,
+ "msg":"success"
+}
+
+
+#### 获取类似微信朋友圈的动态列表
+请求:
+
+
+[点击这里测试](http://apijson.cn:8080/get/{"[]":{"page":0,"count":2,"Moment":{"content$":"%2525a%2525"},"User":{"id@":"%252FMoment%252FuserId","@column":"id,name,head"},"Comment[]":{"count":2,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
+
+返回:
+{
+ "[]":{ //请求一个数组
+ "page":0, //数组条件
+ "count":2,
+ "Moment":{ //请求一个名为Moment的对象
+ "content$":"%a%" //对象条件,搜索content中包含a的动态
+ },
+ "User":{
+ "id@":"/Moment/userId", //User.id = Moment.userId 缺省引用赋值路径,从所处容器的父容器路径开始
+ "@column":"id,name,head" //指定返回字段
+ },
+ "Comment[]":{ //请求一个名为Comment的数组,并去除Comment包装
+ "count":2,
+ "Comment":{
+ "momentId@":"[]/Moment/id" //Comment.momentId = Moment.id 完整引用赋值路径
+ }
+ }
+ }
+}
+
+
+{
+ "[]":[
+ {
+ "Moment":{
+ "id":15,
+ "userId":70793,
+ "date":1486541171000,
+ "content":"APIJSON is a JSON Transmission Protocol…",
+ "praiseUserIdList":[
+ 82055,
+ 82002,
+ 82001
+ ],
+ "pictureList":[
+ "http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
+ "http://common.cnblogs.com/images/icon_weibo_24.png"
+ ]
+ },
+ "User":{
+ "id":70793,
+ "name":"Strong",
+ "head":"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000"
+ },
+ "Comment[]":[
+ {
+ "id":176,
+ "toId":166,
+ "userId":38710,
+ "momentId":15,
+ "date":1490444883000,
+ "content":"thank you"
+ },
+ {
+ "id":1490863469638,
+ "toId":0,
+ "userId":82002,
+ "momentId":15,
+ "date":1490863469000,
+ "content":"Just do it"
+ }
+ ]
+ },
+ {
+ "Moment":{
+ "id":58,
+ "userId":90814,
+ "date":1485947671000,
+ "content":"This is a Content...-435",
+ "praiseUserIdList":[
+ 38710,
+ 82003,
+ 82005,
+ 93793,
+ 82006,
+ 82044,
+ 82001
+ ],
+ "pictureList":[
+ "http://static.oschina.net/uploads/img/201604/22172507_aMmH.jpg"
+ ]
+ },
+ "User":{
+ "id":90814,
+ "name":7,
+ "head":"http://static.oschina.net/uploads/user/51/102723_50.jpg?t=1449212504000"
+ },
+ "Comment[]":[
+ {
+ "id":13,
+ "toId":0,
+ "userId":82005,
+ "momentId":58,
+ "date":1485948050000,
+ "content":"This is a Content...-13"
+ },
+ {
+ "id":77,
+ "toId":13,
+ "userId":93793,
+ "momentId":58,
+ "date":1485948050000,
+ "content":"This is a Content...-77"
+ }
+ ]
+ }
+ ],
+ "code":200,
+ "msg":"success"
+}
+
+
+
+
+
+
+
+
+[在线测试](http://apijson.cn/api)
+
+
+
+
+## 2.对比传统RESTful方式
+
+###
-
-
-
-#### Get an array of Users
-
-Request:
-2.1 开发流程
+ 开发流程 | 传统方式 | APIJSON
+-------- | ------------ | ------------
+ 接口传输 | 等后端编辑接口,然后更新文档,前端再按照文档编辑请求和解析代码 | 前端按照自己的需求编辑请求和解析代码。
没有接口,更不需要文档!前端再也不用和后端沟通接口或文档问题了!
+ 兼容旧版 | 后端增加新接口,用v2表示第2版接口,然后更新文档 | 什么都不用做!
+
+
+
+### 2.2 前端请求
+ 前端请求 | 传统方式 | APIJSON
+-------- | ------------ | ------------
+ 要求 | 前端按照文档在对应URL后面拼接键值对 | 前端按照自己的需求在固定URL后拼接JSON
+ URL | 不同的请求对应不同的URL,基本上有多少个不同的请求就得有多少个接口URL | 相同的操作方法(增删改查)都用同一个URL,
大部分请求都用7个通用接口URL的其中一个
+ 键值对 | key=value | key:value
+ 结构 | 同一个URL内table_name只能有一个
base_url/get/table_name?
key0=value0&key1=value1... | 同一个URL后TableName可传任意数量个
base_url/get/
{
TableName0:{
key0:value0,
key1:value1,
...
},
TableName1:{
...
}
...
}
+
+
+
+### 2.3 后端操作
+ 后端操作 | 传统方式 | APIJSON
+-------- | ------------ | ------------
+ 解析和返回 | 取出键值对,把键值对作为条件用预设的的方式去查询数据库,最后封装JSON并返回给前端 | 把Parser#parse方法的返回值返回给前端就行
+ 返回JSON结构的设定方式 | 由后端设定,前端不能修改 | 由前端设定,后端不能修改
+
+
+
+### 2.4 前端解析
+ 前端解析 | 传统方式 | APIJSON
+-------- | ------------ | ------------
+ 查看方式 | 查文档或问后端,或等请求成功后看日志 | 看请求就行,所求即所得,不用查、不用问、不用等。也可以等请求成功后看日志
+ 解析方法 | 用JSON解析器来解析JSONObject | 可以用JSONResponse解析JSONObject,或使用传统方式
+
+
+
+### 2.5 前端对应不同需求的请求
+ 前端的请求 | 传统方式 | APIJSON
+-------- | ------------ | ------------
+ User | base_url/get/user?id=38710 | [base_url/get/
{
"User":{
"id":38710
}
}](http://apijson.cn:8080/get/{"User":{"id":38710}})
+ Moment和对应的User | 分两次请求
Moment:
base_url/get/moment?userId=38710
User:
base_url/get/user?id=38710 | [base_url/get/
{
"Moment":{
"userId":38710
},
"User":{
"id":38710
}
}](http://apijson.cn:8080/get/{"Moment":{"userId":38710},"User":{"id":38710}})
+ User列表 | base_url/get/user/list?
page=0&count=3&sex=0 | [base_url/get/
{
"User[]":{
"page":0,
"count":3,
"User":{
"sex":0
}
}
}](http://apijson.cn:8080/get/{"User[]":{"page":0,"count":3,"User":{"sex":0}}})
+ Moment列表,
每个Moment包括
1.发布者User
2.前3条Comment | Moment里必须有
1.User对象
2.Comment数组
base_url/get/moment/list?
page=0&count=3&commentCount=3 | [base_url/get/
{
"[]":{
"page":0,
"count":3,
"Moment":{},
"User":{
"id@":"/Moment/userId"
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"[]":{"page":0,"count":3,"Moment":{},"User":{"id@":"%252FMoment%252FuserId"},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
+ User发布的Moment列表,
每个Moment包括
1.发布者User
2.前3条Comment | 1.Moment里必须有User对象和Comment数组
2.字段名必须查接口文档,例如评论数量字段名可能是
commentCount,comment_count或者简写cmt_count等各种奇葩写法...
base_url/get/moment/list?
page=0&count=3
&commentCount=3&userId=38710 | 有以下几种方式:
① 把以上请求里的
"Moment":{}, "User":{"id@":"/Moment/userId"}
改为
["Moment":{"userId":38710}, "User":{"id":38710}](http://apijson.cn:8080/get/{"[]":{"page":0,"count":3,"Moment":{"userId":38710},"User":{"id":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
② 或把User放在上面的最外层省去重复的User
[base_url/get/
{
"User":{
"id":38710
},
"[]":{
"page":0,
"count":3,
"Moment":{
"userId":38710
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"User":{"id":38710},"[]":{"page":0,"count":3,"Moment":{"userId":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
③ 如果User之前已经获取到了,还可以不传User来节省请求和返回数据的流量并提升速度
[base_url/get/
{
"[]":{
"page":0,
"count":3,
"Moment":{
"userId":38710
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"[]":{"page":0,"count":3,"Moment":{"userId":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
+
+
+
+### 2.6 后端对应不同请求的返回结果
+ 后端的返回结果 | 传统方式 | APIJSON
+-------- | ------------ | ------------
+ User | {
"data":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
} | {
"User":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
}
+ Moment和对应的User | 分别返回两次请求的结果,获取到Moment后取出userId作为User的id条件去查询User
Moment:
{
"data":{
"id":235,
"content":"xxx",
...
},
"code":200,
"msg":"success"
}
User:
{
"data":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
} | 一次性返回,没有传统方式导致的 长时间等待结果、两次结果间关联、线程多次切换 等问题
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"User":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
}
+ User列表 | {
"data":[
{
"id":38710,
"name":"xxx",
...
},
{
"id":82001,
...
},
...
],
"code":200,
"msg":"success"
} | {
"User[]":[
{
"id":38710,
"name":"xxx",
...
},
{
"id":82001,
...
},
...
],
"code":200,
"msg":"success"
}
+ Moment列表,每个Moment包括发布者User和前3条Comment | Moment里必须有
1.User对象
2.Comment数组
{
"data":[
{
"id":235,
"content":"xxx",
...,
"User":{
...
},
"Comment":[
...
]
},
{
"id":301,
"content":"xxx",
...,
"User":{
...
},
...
},
...
],
"code":200,
"msg":"success"
} | 1.高灵活,可任意组合
2.低耦合,逻辑很清晰
{
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"User":{
...
},
"Comment[]":[
...
]
},
{
"Moment":{
"id":301,
"content":"xxx",
...
},
"User":{
...
},
...
},
...
],
"code":200,
"msg":"success"
}
+ User发布的Moment列表,每个Moment包括发布者User和前3条Comment | 1.大量重复User,浪费流量和服务器性能
2.优化很繁琐,需要后端扩展接口、写好文档,前端/前端再配合优化
{
"data":[
{
"id":235,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
{
"id":470,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
{
"id":511,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
{
"id":595,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
...
],
"code":200,
"msg":"success"
} | 以上不同请求方式的结果:
① 常规请求
{
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment[]":[
...
]
},
...
],
"code":200,
"msg":"success"
}
② 省去重复的User
{
"User":{
"id":38710,
"name":"Tommy",
...
},
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"Comment[]":[
...
]
},
...
],
"code":200,
"msg":"success"
}
③ 不查询已获取到的User
{
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"Comment[]":[
...
]
},
...
],
"code":200,
"msg":"success"
}
+
+
+1.base_url指基地址,一般是顶级域名,其它分支url都是在base_url后扩展。如base_url:http://apijson.cn:8080/ ,对应的GET分支url:http://apijson.cn:8080/get/ 。下同。
+2.请求中的key或value任意一个为null值时,这个 key:value键值对 被视为无效。下同。
+3.请求中的 / 需要转义。JSONRequest.java已经用URLEncoder.encode转义,不需要再写;但如果是浏览器或Postman等直接输入url/request,需要把request中的所有 / 都改成 %252F 。下同。
+4.code,指返回结果中的状态码,200表示成功,其它都是错误码,值全部都是HTTP标准状态码。下同。
+5.msg,指返回结果中的状态信息,对成功结果或错误原因的详细说明。下同。
+6.code和msg总是在返回结果的同一层级成对出现。对所有请求的返回结果都会在最外层有一对总结式code和msg。下同。
+7.id等字段对应的值仅供说明,不一定是数据库里存在的,请求里用的是真实存在的值。下同。
+
+
+
+
+## 3.设计规范
+
+###
3.1 操作方法
+
+ 方法及说明 | URL | Request | Response
+------------ | ------------ | ------------ | ------------
+GET:
普通获取数据,
可用浏览器调试 | base_url/get/ | {
TableName:{
…
}
}
{…}内为限制条件
例如获取一个 id = 235 的 Moment:
[{
"Moment":{
"id":235
}
}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fget&type=JSON&json={"Moment"%3A{"id"%3A235}})
后端校验通过后自动解析为 SQL 并执行:
`SELECT * FROM Moment WHERE id=235 LIMIT 1` | {
TableName:{
...
},
"code":200,
"msg":"success"
}
例如
{
"Moment":{
"id":235,
"userId":38710,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"code":200,
"msg":"success"
}
+HEAD:
普通获取数量,
可用浏览器调试 | base_url/head/ | {
TableName:{
…
}
}
{…}内为限制条件
例如获取一个 id = 38710 的 User 所发布的 Moment 总数:
[{
"Moment":{
"userId":38710
}
}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fhead&type=JSON&json={"Moment"%3A{"userId"%3A38710}})
后端校验通过后自动解析为 SQL 并执行:
`SELECT count(*) FROM Moment WHERE userId=38710 LIMIT 1` | {
TableName:{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
例如
{
"Moment":{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
+GETS:
安全/私密获取数据,
用于获取钱包等
对安全性要求高的数据 | base_url/gets/ | 最外层加一个 "tag":tag,例如 ["tag":"Privacy"](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={"tag"%3A"Privacy","Privacy"%3A{"id"%3A82001}}),其它同GET | 同GET
+HEADS:
安全/私密获取数量,
用于获取银行卡数量等
对安全性要求高的数据总数 | base_url/heads/ | 最外层加一个 "tag":tag,例如 ["tag":"Verify"](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fheads&type=JSON&json={"tag"%3A"Verify","Verify"%3A{"phone"%3A13000082001}}),其它同HEAD | 同HEAD
+POST:
新增数据 | base_url/post/ | 单个:
{
TableName:{
…
},
"tag":tag
}
{…}中id由后端生成,不能传
例如当前登录用户 38710 发布一个新 Comment:
[{
"Comment":{
"momentId":12,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Comment"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fpost&type=JSON&json={"Comment":{"momentId":12,"content":"APIJSON%20is%20the%20Real-Time%20coding-free,%20powerful%20and%20secure%20ORM."},"tag":"Comment"})
后端校验通过后自动解析为 SQL 并执行:
`INSERT INTO Comment(userId,momentId,content) VALUES(38710,12,'APIJSON is the real-time coding-free, powerful and secure ORM')`
批量:
{
TableName\[]:\[{
…
}, {
…
}
…
],
"tag":tag
}
{…}中id由后端生成,不能传
例如当前登录用户 82001 发布 2 个 Comment:
[{
"Comment[]":[{
"momentId":12,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
}, {
"momentId":15,
"content":"APIJSON is a JSON transmision protocol."
}],
"tag":"Comment:[]"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fpost&type=JSON&json={"Comment[]":[{"momentId":12,"content":"APIJSON%20is%20the%20Real-Time%20coding-free,%20powerful%20and%20secure%20ORM."},{"momentId":15,"content":"APIJSON%20is%20a%20JSON%20transmision%20protocol."}],"tag":"Comment:[]"})
后端校验通过后自动解析为 SQL 并执行:
`INSERT INTO Comment(userId,momentId,content) VALUES(82001,12,'APIJSON is the real-time coding-free, powerful and secure ORM');`
`INSERT INTO Comment(userId,momentId,content) VALUES(82001,15,'APIJSON is a JSON transmision protocol.');` | 单个:
{
TableName:{
"code":200,
"msg":"success",
"id":38710
},
"code":200,
"msg":"success"
}
例如
{
"Comment":{
"code":200,
"msg":"success",
"id":120
},
"code":200,
"msg":"success"
}
批量:
{
TableName:{
"code":200,
"msg":"success",
"count":5,
"id[]":[1, 2, 3, 4, 5]
},
"code":200,
"msg":"success"
}
例如
{
"Comment":{
"code":200,
"msg":"success",
"count":2,
"id[]":\[1, 2]
},
"code":200,
"msg":"success"
}
+PUT:
修改数据,
只修改所传的字段 | base_url/put/ | {
TableName:{
"id":id,
…
},
"tag":tag
}
{…} 中 id 或 id{} 至少传一个
例如当前登录用户 82001 修改 id = 235 的 Moment 的 content:
[{
"Moment":{
"id":235,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Moment"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fput&type=JSON&json={"Moment":{"id":235,"content":"APIJSON%20is%20the%20Real-Time%20coding-free,%20powerful%20and%20secure%20ORM."},"tag":"Moment"})
后端校验通过后自动解析为 SQL 并执行:
`UPDATE Moment SET content='APIJSON is the real-time coding-free, powerful and secure ORM' WHERE id=235 AND userId=82001 LIMIT 1`
批量除了 id{}:\[] 也可类似批量 POST,只是每个 {...} 里面都必须有 id。
"tag":"Comment[]" 对应对象 "Comment":{"id{}":[1,2,3]},表示指定记录全部统一设置;
"tag":"Comment:[]" 多了冒号,对应数组 "Comment[]":[{"id":1},{"id":2},{"id":3}],表示每项单独设置 | 同POST
+DELETE:
删除数据 | base_url/delete/ | {
TableName:{
"id":id
},
"tag":tag
}
{…} 中 id 或 id{} 至少传一个,一般只传 id 或 id{}
例如当前登录用户 82001 批量删除 id = 100,110,120 的 Comment:
[{
"Comment":{
"id{}":[100,110,120]
},
"tag":"Comment[]"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fdelete&type=JSON&json={"Comment":{"id{}":[100,110,120]},"tag":"Comment[]"})
后端校验通过后自动解析为 SQL 并执行:
`DELETE FROM Comment WHERE id IN(100,110,120) AND userId=82001 LIMIT 3` | {
TableName:{
"code":200,
"msg":"success",
"id[]":[100,110,120]
"count":3
},
"code":200,
"msg":"success"
}
例如
{
"Comment":{
"code":200,
"msg":"success",
"id[]":[100,110,120],
"count":3
},
"code":200,
"msg":"success"
}
+以上接口的简单形式:
base_url/{method}/{tag} | GET: 普通获取数据
base_url/get/{tag}
HEAD: 普通获取数量
base_url/head/{tag}
GETS: 安全/私密获取数据
base_url/gets/{tag}
HEADS: 安全/私密获取数量
base_url/heads/{tag}
POST: 新增数据
base_url/post/{tag}
PUT: 修改数据 base_url/put/{tag}
DELETE: 删除数据
base_url/delete/{tag} | 例如安全/私密获取一个 id = 82001 的 Privacy:
[base_url/gets/Privacy/
{"id":82001}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets%2FPrivacy&type=JSON&json={"id"%3A82001})
相当于
[base_url/gets/
{"tag":"Privacy", "Privacy":{"id":82001}}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={"tag"%3A"Privacy","Privacy"%3A{"id"%3A82001}})
例如批量修改 id = 114, 124 的 Comment 的 content:
[base_url/put/Comemnt[]/
{
"id{}":[114,124],
"content":"test multi put"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fput%2FComment[]&type=JSON&json={"id{}"%3A[114,124],"content"%3A"test%20multi%20put"})
相当于
[base_url/put/
{
"tag":"Comment[]",
"Comment":{
"id{}":[114,124],
"content":"test multi put"
}
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fput&type=JSON&json={"tag"%3A"Comment[]","Comment"%3A{"id{}"%3A[114,124],"content"%3A"test%20multi%20put"}}) | 同以上对应的方法
+
+1.TableName指要查询的数据库表Table的名称字符串。第一个字符为大写字母,剩下的字符要符合英语字母、数字、下划线中的任何一种。对应的值的类型为JSONObject,结构是 {...},里面放的是Table的字段(列名)。下同。
+2."tag":tag 后面的tag是非GET、HEAD请求中匹配请求的JSON结构的标识,一般是要查询的Table的名称,由后端Request表中指定。下同。
+3.GET、HEAD请求是开放请求,可任意组合任意嵌套。其它请求为受限制的安全/私密请求,对应的 方法(method), 标识(tag), 版本(version), 结构(structure) 都必须和 后端Request表中所指定的 一一对应,否则请求将不被通过。version 不传、为 null 或 <=0 都会使用最高版本,传了其它有效值则会使用最接近它的最低版本。下同。
+4.GETS与GET、HEADS与HEAD分别为同一类型的操作方法,请求稍有不同但返回结果相同。下同。
+5.在HTTP通信中,自动化接口(get,gets,head,heads,post,put,delete) 全用HTTP POST请求。下同。
+6.所有JSONObject都视为容器(或者文件夹),结构为 {...} ,里面可以放普通对象或子容器。下同。
+7.每个对象都有一个唯一的路径(或者叫地址),假设对象名为refKey,则用 key0/key1/.../refKey 表示。下同。
+
+
+
+### 3.2 功能符
+
+ 功能 | 键值对格式 | 使用示例
+------------ | ------------ | ------------
+ 查询数组 | "key[]":{},后面是 JSONObject,key 可省略。当 key 和里面的 Table 名相同时,Table 会被提取出来,即 {Table:{Content}} 会被转化为 {Content} | [{"User[]":{"User":{}}}](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{}}}),查询一个 User 数组。这里 key 和 Table 名都是 User,User 会被提取出来,即 {"User":{"id", ...}} 会被转化为 {"id", ...},如果要进一步提取 User 中的 id,可以把 User[] 改为 User-id[],其中 - 用来分隔路径中涉及的 key
+ 匹配选项范围 | "key{}":[],后面是 JSONArray,作为 key 可取的值的选项 | ["id{}":[38710,82001,70793]](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":[38710,82001,70793]}}}),对应 SQL 是`id IN(38710,82001,70793)`,查询 id 符合 38710,82001,70793 中任意一个的一个 User 数组
+ 匹配条件范围 | "key{}":"条件0,条件1...",条件为 SQL 表达式字符串,可进行数字比较运算等 | ["id{}":"<=80000,\>90000"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":"<=80000,\>90000"}}}),对应 SQL 是`id<=80000 OR id>90000`,查询 id 符合 id\<=80000 \| id>90000 的一个 User 数组
+ 包含选项范围 | "key<\>":value => "key<\>":[value],key 对应值的类型必须为 JSONArray,value 值类型只能为 Boolean, Number, String 中的一种 | ["contactIdList<\>":38710](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"contactIdList<\>":38710}}}),对应SQL是`json_contains(contactIdList,38710)`,查询 contactIdList 包含 38710 的一个 User 数组
+ 判断是否存在 | "key}{@":{
"from":"Table",
"Table":{ ... }
}
其中:
}{ 表示 EXISTS;
key 用来标识是哪个判断;
@ 后面是 子查询 对象,具体见下方 子查询 的说明。 | ["id}{@":{
"from":"Comment",
"Comment":{
"momentId":15
}
}](http://apijson.cn:8080/get/{"User":{"id}{@":{"from":"Comment","Comment":{"momentId":15}}}})
WHERE EXISTS(SELECT * FROM Comment WHERE momentId=15)
+ 远程调用函数 | "key()":"函数表达式",函数表达式为 function(key0,key1...),会调用后端对应的函数 function(JSONObject request, String key0, String key1...),实现 参数校验、数值计算、数据同步、消息推送、字段拼接、结构变换 等特定的业务逻辑处理,
可使用 - 和 + 表示优先级,解析 key-() > 解析当前对象 > 解析 key() > 解析子对象 > 解析 key+() | ["isPraised()":"isContain(praiseUserIdList,userId)"](http://apijson.cn:8080/get/{"Moment":{"id":301,"isPraised()":"isContain(praiseUserIdList,userId)"}}),会调用远程函数 [boolean isContain(JSONObject request, String array, String value)](https://github.com/APIJSON/apijson-framework/blob/master/src/main/java/apijson/framework/APIJSONFunctionParser.java#L361-L374) ,然后变为 "isPraised":true 这种(假设点赞用户id列表包含了userId,即这个User点了赞)
+ 存储过程 | "@key()":"SQL函数表达式",函数表达式为
function(key0,key1...)
会调用后端数据库对应的存储过程 SQL函数
function(String key0, String key1...)
除了参数会提前赋值,其它和 远程函数 一致 | ["@limit":10,
"@offset":0,
"@procedure()":"getCommentByUserId(id,@limit,@offset)"](http://apijson.cn:8080/get/{"User":{"@limit":10,"@offset":0,"@procedure()":"getCommentByUserId(id,@limit,@offset)"}})
会转为
`getCommentByUserId(38710,10,0)`
来调用存储过程 SQL 函数
`getCommentByUserId(IN id bigint, IN limit int, IN offset int)`
然后变为
"procedure":{
"count":-1,
"update":false,
"list":[]
}
其中 count 是指写操作影响记录行数,-1 表示不是写操作;update 是指是否为写操作(增删改);list 为返回结果集
+ 引用赋值 | "key@":"key0/key1/.../refKey",引用路径为用/分隔的字符串。以/开头的是缺省引用路径,从声明key所处容器的父容器路径开始;其它是完整引用路径,从最外层开始。
被引用的refKey必须在声明key的上面。如果对refKey的容器指定了返回字段,则被引用的refKey必须写在@column对应的值内,例如 "@column":"refKey,key1,..." | ["Moment":{
"userId":38710
},
"User":{
"id@":"/Moment/userId"
}](http://apijson.cn:8080/get/{"Moment":{"userId":38710},"User":{"id@":"%252FMoment%252FuserId"}})
User内的id引用了与User同级的Moment内的userId,
即User.id = Moment.userId,请求完成后
"id@":"/Moment/userId" 会变成 "id":38710
+ 子查询 | "key@":{
"range":"ALL",
"from":"Table",
"Table":{ ... }
}
其中:
range 可为 ALL,ANY;
from 为目标表 Table 的名称;
@ 后面的对象类似数组对象,可使用 count 和 join 等功能。 | ["id@":{
"from":"Comment",
"Comment":{
"@column":"min(userId)"
}
}](http://apijson.cn:8080/get/{"User":{"id@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}})
WHERE id=(SELECT min(userId) FROM Comment)
+ 模糊搜索 | `"key$":"SQL搜索表达式"` => `"key$":["SQL搜索表达式"]`,任意SQL搜索表达式字符串,如 %key%(包含key), key%(以key开始), %k%e%y%(包含字母k,e,y) 等,%表示任意字符 | ["name$":"%m%"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name$":"%2525m%2525"}}}),对应SQL是`name LIKE '%m%'`,查询name包含"m"的一个User数组
+ 正则匹配 | "key~":"正则表达式" => "key~":["正则表达式"],任意正则表达式字符串,如 ^[0-9]+$ ,*~ 忽略大小写,可用于高级搜索 | ["name~":"^[0-9]+$"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name~":"^[0-9]%252B$"}}}),对应SQL是`name REGEXP '^[0-9]+$'`,查询name中字符全为数字的一个User数组
+ 连续范围 | "key%":"start,end" => "key%":["start,end"],其中 start 和 end 都只能为 Boolean, Number, String 中的一种,如 "2017-01-01,2019-01-01" ,["1,90000", "82001,100000"] ,可用于连续范围内的筛选 | ["date%":"2017-10-01,2018-10-01"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"date%2525":"2017-10-01,2018-10-01"}}}),对应SQL是`date BETWEEN '2017-10-01' AND '2018-10-01'`,查询在2017-10-01和2018-10-01期间注册的用户的一个User数组
+ 新建别名 | ① "name:alias",name 映射为 alias,用 alias 替代 name,可用于 column,Table,SQL 函数 等,只用于 GET 类型、HEAD 类型的请求
② 函数调用映射
"@key": "fun:avg(id);keyA:(keyB)",
"fun>": 1,
"keyA": 1
其中 fun:fun(arg) 把 SQL 函数调用 fun(arg) 作为左侧表达式替代 fun,即 fun(arg) > 1;
keyA:(keyB) 表示将字段 keyA 重命名为 keyB,即实际 SQL 中为 keyB = 1,常用于重命名冲突的多条件同名字段。 | ① ["@column":"toId:parentId"](http://apijson.cn:8080/get/{"Comment":{"@column":"id,toId:parentId","id":51}}),对应 SQL 是 `toId AS parentId`,将查询的字段 toId 变为 parentId 返回
② ["@key": "len:length(content);mid:(momentId)",
"len<=": 10,
"mid": 12,
"momentId": 15,
"@combine": "(len<= \\| mid) & momentId"](http://apijson.cn/api?type=JSON&json={%22Comment%22:{%22@key%22:%22len%3Alength(content)%3Bmid%3A(momentId)%22,%22len%3C=%22:10,%22mid%22:12,%22momentId%22:15,%22@combine%22:%22(len%3C%3D%20%7C%20mid)%20%26%20momentId%22}})
对应 SQL 是 `(length(content) <= 10 OR momentId = 12) AND momentId = 15`
+ 增加 或 扩展 | "key+":Object,Object的类型由key指定,且类型为Number,String,JSONArray中的一种。如 82001,"apijson",["url0","url1"] 等。只用于PUT请求 | "praiseUserIdList+":[82001],对应SQL是`json_insert(praiseUserIdList,82001)`,添加一个点赞用户id,即这个用户点了赞
+ 减少 或 去除 | "key-":Object,与"key+"相反 | "balance-":100.00,对应SQL是`balance = balance - 100.00`,余额减少100.00,即花费了100元
+ 比较运算 | >, <, >=, <= 比较运算符,用于
① 提供 "id{}":"<=90000" 这种条件范围的简化写法
② 实现子查询相关比较运算
不支持 "key=":Object 和 "key!=":Object 这两种写法,直接用更简单的 "key":Object 和 "key!":Object 替代。 | ① ["id<=":90000](http://apijson.cn:8080/get/{"[]":{"User":{"id<=":90000}}}),对应 SQL 是`id<=90000`,查询符合id<=90000的一个User数组
② ["id>@":{
"from":"Comment",
"Comment":{
"@column":"min(userId)"
}
}](http://apijson.cn:8080/get/{"User":{"id>@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}})
WHERE id>(SELECT min(userId) FROM Comment)
+ 逻辑运算 | &, \|, ! 逻辑运算符,对应数据库 SQL 中的 AND, OR, NOT。
横或纵与:同一键值对的值内条件默认 \| 或连接,可以在 key 后加逻辑运算符来具体指定;不同键值对的条件默认 & 与连接,可以用下面说明的对象关键词 @combine 来具体指定。
① & 可用于 "key&{}":"条件"等
② \| 可用于 "key\|{}":"条件", "key\|{}":[]等,一般可省略
③ ! 可单独使用,如 "key!":Object,也可像 &,\| 一样配合其他功能符使用
"key!":null 无效,null 值会导致整个键值对被忽略解析,可以用 "key{}":"!=null" 替代,
"key":null 同理,用 "key{}":"=null" 替代。 | ① ["id&{}":">80000,<=90000"](http://apijson.cn:8080/head/{"User":{"id&{}":">80000,<=90000"}}),对应SQL是`id>80000 AND id<=90000`,即id满足id>80000 & id<=90000
② ["id\|{}":">90000,<=80000"](http://apijson.cn:8080/head/{"User":{"id\|{}":">90000,<=80000"}}),同 "id{}":">90000,<=80000",对应 SQL 是`id>90000 OR id<=80000`,即 id 满足 id>90000 \| id<=80000
③ ["id!{}":[82001,38710]](http://apijson.cn:8080/head/{"User":{"id!{}":[82001,38710]}}),对应 SQL 是`id NOT IN(82001,38710)`,即 id 满足 ! (id=82001 \| id=38710),可过滤黑名单的消息
+ 数组关键词,可自定义 | "key":Object,key为 "[]":{} 中 {} 内的关键词,Object 的类型由 key 指定
① "count":5,查询数量,0 表示最大值,默认值为 10,默认最大值为 100
② "page":1,查询页码,从 0 开始,默认值为 0,默认最大值为 100,一般和 count 一起用
③ "query":2,查询内容
0-对象,1-总数和分页详情,2-数据、总数和分页详情
总数关键词为 total,分页详情关键词为 info,
它们都和 query 同级,通过引用赋值得到自定义 key:value 键值对,不传则返回默认键值对,例如
"total@":"/[]/total", "info@":"/[]/info"
这里query及total仅为GET类型的请求提供方便,
一般可直接用HEAD类型的请求获取总数
④ "compat": true
处理最外层查询字段有特殊处理的情况下 "query":2 返回查询总数不准确的问题:如DISTINCT去重、Aggregate 函数等
⑤ "join":"&/Table0,\"join":{
"&/Table0":{}, // 支持 ON 多个字段关联,
"\ "key0":value0, // 其它ON条件
"key2":value2,
...
"@combine":"...", // 其它ON条件的组合方式
"@column":"...", // 外层 SELECT
"@group":"...", // 外层 GROUP BY
"@having":"..." // 外层 HAVING
}
}
多表连接方式:
"@" - APP JOIN
"\<" - LEFT JOIN
">" - RIGHT JOIN
"&" - INNER JOIN
"\|" - FULL JOIN
"!" - OUTER JOIN
"*" - CROSS JOIN
"^" - SIDE JOIN
"(" - ANTI JOIN
")" - FOREIGN JOIN
其中 @ APP JOIN 为应用层连表,会从已查出的主表里取得所有副表 key@ 关联的主表内的 refKey 作为一个数组 refKeys: [value0, value1...],然后把原来副表 count 次查询 key=$refKey 的 SQL 用 key IN($refKeys) 的方式合并为一条 SQL 来优化性能;
其它 JOIN 都是 SQL JOIN,具体功能和 MySQL,PostgreSQL 等数据库的 JOIN 一一对应
`"join":"`"MainTable":{},`
`"ViceTable":{"key@":"/MainTable/refKey"}`
会对应生成
`MainTable LEFT JOIN ViceTable`
`ON ViceTable.key=MainTable.refKey` AND 其它ON条件
除了 = 等价关联,也支持 ! 不等关联、\> \< \>= \<= 等比较关联和 $ ~ {} <> 等其它复杂关联方式
⑥ "otherKey":Object,自定义关键词,名称和以上系统关键词不一样,且原样返回上传的值 | ① 查询User数组,最多5个:
["count":5](http://apijson.cn:8080/get/{"[]":{"count":5,"User":{}}})
对应 SQL 是`LIMIT 5`
② 查询第3页的User数组,每页5个:
["count":5,
"page":3](http://apijson.cn:8080/get/{"[]":{"count":5,"page":3,"User":{}}})
对应 SQL 是`LIMIT 5 OFFSET 15`
③ 查询User数组和对应的User总数:
["[]":{
"query":2,
"User":{}
},
"total@":"/[]/total", // 可省略
"info@":"/[]/info" // 可省略](http://apijson.cn:8080/get/{"[]":{"query":2,"count":5,"User":{}},"total@":"%252F[]%252Ftotal","info@":"%252F[]%252Finfo"})
返回的数据中,总数及分页详情结构为:
"total":139, // 总数
"info":{ // 分页详情
"total":139, // 总数
"count":5, // 每页数量
"page":0, // 当前页码
"max":27, // 最大页码
"more":true, // 是否还有更多
"first":true, // 是否为首页
"last":false // 是否为尾页
}
④查询User数组ID唯一情况下的User总数:
["[]":{
"query":2,
"compat":"true",
"User":{
"@column":"DISTINCT id"
}
}](http://apijson.cn:8080/get/{"[]":{"query":2,"count":5,"User":{}}})
返回的数据和结构同上
⑤ Moment INNER JOIN User LEFT JOIN Comment:
["[]":{
"join":"&/User/id@,\ "Moment":{
"@group":"id" // 主副表不是一对一,要去除重复数据
},
"User":{
"name~":"t",
"id@":"/Moment/userId"
},
"Comment":{
"momentId@":"/Moment/id"
}
}](http://apijson.cn/api/?type=JSON&url=http://apijson.cn:8080/get&json=%7B%22%5B%5D%22:%7B%22count%22:5,%22join%22:%22%26%2FUser%2Fid@,%3C%2FComment%22,%22Moment%22:%7B%22@column%22:%22id,userId,content%22,%22@group%22:%22id%22%7D,%22User%22:%7B%22name~%22:%22t%22,%22id@%22:%22%2FMoment%2FuserId%22,%22@column%22:%22id,name,head%22%7D,%22Comment%22:%7B%22momentId@%22:%22%2FMoment%2Fid%22,%22@column%22:%22id,momentId,content%22%7D%7D%7D)
⑥ 每一层都加当前用户名:
["User":{},
"[]":{
"name@":"User/name", // 自定义关键词
"Moment":{}
}](http://apijson.cn:8080/get/{"User":{},"[]":{"name@":"User%252Fname","Moment":{}}})
+ 对象关键词,可自定义 | "@key":Object,@key 为 Table:{} 中 {} 内的关键词,Object 的类型由 @key 指定
① "@combine":"key0 \| (key1 & (key2 \| !key3))...",条件组合方式,最终按
(其它key条件 AND 连接) AND (key0条件 OR (key1条件 AND (key2条件 OR (NOT key3条件))))
这种方式连接,其中 "其它key" 是指与 @combine 在同一对象,且未被它声明的条件 key,默认都是 & 连接。注意不要缺少或多余任何一个空格。
② "@column":"column;function(arg)...",返回字段
③ "@order":"column0+,column1-...",排序方式
④ "@group":"column0,column1...",分组方式。如果 @column 里声明了 Table 的 id,则 id 也必须在 @group 中声明;其它情况下必须满足至少一个条件:
1.分组的 key 在 @column 里声明
2.Table 主键在 @group 中声明
⑤ "@having":"function0(...)?value0;function1(...)?value1;function2(...)?value2..." // OR 连接,或
"@having&":"function0(...)?value0;function1(...)?value1;function2(...)?value2..." // AND 连接,或
"@having":{
"h0":"function0(...)?value0",
"h1":function1(...)?value1",
"h2":function2(...)?value2...",
"@combine":"h0 & (h1 \| !h2)" // 任意组合,非必传
}
SQL 函数条件,一般和 @group 一起用,函数一般在 @column 里声明
⑥ "@schema":"sys",集合空间(数据库名/模式),非默认的值可通过它来指定,可以在最外层作为全局默认配置
⑦ "@database":"POSTGRESQL",数据库类型,非默认的值可通过它来指定,可以在最外层作为全局默认配置
⑧ "@datasource":"DRUID",跨数据源,非默认的值可通过它来指定,可以在最外层作为全局默认配置
⑨ "@json":"key0,key1...",转为 JSON 格式返回,符合 JSONObject 则转为 {...},符合 JSONArray 则转为 \[...]
⑩ "@role":"OWNER",来访角色,包括
UNKNOWN,LOGIN,CONTACT,CIRCLE,OWNER,ADMIN,
可以在最外层作为全局默认配置,
可自定义其它角色并重写 Verifier.verify 等相关方法来自定义校验
⑪ "@explain":true,性能分析,可以在最外层作为全局默认配置
⑫ "@raw":"key0,key1...",其中 key0, key1 都对应有键值对
"key0":"SQL片段或SQL片段的别名",
"key1":"SQL片段或SQL片段的别名"
自定义原始SQL片段,可扩展嵌套SQL函数等复杂语句,必须是后端已配置的,只有其它功能符都做不到才考虑,谨慎使用,注意防 SQL 注入
⑬ "@null":"key1,key2...",空值键值对,自动插入 key1:null, key2:null ... 并作为有效键值对执行,作为条件时对应 SQL 是 `WHERE tag IS NULL`,作为值时对应 SQL 是 `SET tag = NULL`
⑭ "@otherKey":Object,自定义关键词,名称和以上系统关键词不一样,且原样返回上传的值 | ① 搜索 name 或 tag 任何一个字段包含字符 a 的 User 列表:
["name~":"a",
"tag~":"a",
"@combine":"name~ \| tag~"](http://apijson.cn:8080/get/{"User[]":{"count":10,"User":{"@column":"id,name,tag","name~":"a","tag~":"a","@combine":"name~%20%7C%20tag~"}}})
对应SQL是`name REGEXP 'a' OR tag REGEXP 'a'`
② 只查询 id,sex,name 这几列并且请求结果也按照这个顺序:
["@column":"id,sex,name"](http://apijson.cn:8080/get/{"User":{"@column":"id,sex,name","id":38710}})
对应 SQL 是`SELECT id,sex,name`
③ 查询按 name 降序、id 默认顺序 排序的 User 数组:
["@order":"name-,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"User":{"@column":"name,id","@order":"name-,id"}}})
对应 SQL 是`ORDER BY name DESC,id`
④ 查询按 userId 分组的 Moment 数组:
["@group":"userId,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})
对应 SQL 是`GROUP BY userId,id`
⑤ 查询 按 userId 分组、id 最大值>=100 的 Moment 数组:
["@column":"userId;max(id)",
"@group":"userId",
"@having":"max(id)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id)","@group":"userId","@having":"max(id)>=100"}}})
对应 SQL 是`SELECT userId,max(id) ... GROUP BY userId HAVING max(id)>=100`
还可以指定函数返回名:
["@column":"userId;max(id):maxId",
"@group":"userId",
"@having":"(maxId)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id):maxId","@group":"userId","@having":"(maxId)>=100"}}})
对应 SQL 是`SELECT userId,max(id) AS maxId ... GROUP BY userId HAVING (maxId)>=100`
⑥ 查询 sys 内的 User 表:
["@schema":"sys"](http://apijson.cn:8080/get/{"User":{"@schema":"sys"}})
对应 SQL 是`FROM sys.User`
⑦ 查询 PostgreSQL 数据库的 User 表:
["@database":"POSTGRESQL"](http://apijson.cn:8080/get/{"User":{"@database":"POSTGRESQL","@explain":true}})
⑧ 使用 Druid 连接池查询 User 表:
["@datasource":"DRUID"](http://apijson.cn:8080/get/{"User":{"@datasource":"DRUID"}})
⑨ 将 VARCHAR 字符串字段 get 转为 JSONArray 返回:
["@json":"get"](http://apijson.cn:8080/get/{"Access":{"@json":"get"}})
⑩ 查询当前用户的动态:
["@role":"OWNER"](http://apijson.cn:8080/get/{"[]":{"Moment":{"@role":"OWNER"}}})
⑪ 开启性能分析:
["@explain":true](http://apijson.cn:8080/get/{"[]":{"Moment":{"@explain":true}}})
对应 SQL 是`EXPLAIN`
⑫ 统计最近一周偶数 userId 的数量
["@column":"date;left(date,10):day;sum(if(userId%2=0,1,0))",
"@group":"day",
"@having":"to_days(now())-to_days(\`date\`)<=7",
"@raw":"@column,@having"](http://apijson.cn:8080/get/{"[]":{"Moment":{"@column":"date%3bleft(date,10):day%3bsum(if(userId%252=0,1,0))","@group":"day","@having":"to_days(now())-to_days(\`date\`)<=7","@raw":"@column,@having"}}})
对应 SQL 是``SELECT date, left(date,10) AS day, sum(if(userId%2=0,1,0)) ... GROUP BY day HAVING to_days(now())-to_days(`date`)<=7``
⑬ 把用户的标签设置为空
["@null":"tag"](http://apijson.cn/api/?type=JSON&url=http://apijson.cn:8080/put/User&json={%22id%22:82001,%22@null%22:%22tag%22,%22@explain%22:true})
⑭ 从pictureList 获取第 0 张图片:
["@position":0, // 自定义关键词
"firstPicture()":"getFromArray(pictureList,@position)"](http://apijson.cn:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"getFromArray(pictureList,@position)"}})
+ 全局关键词 | 为最外层对象 {} 内的关键词。其中 @database,@schema, @datasource, @role, @explain 基本同对象关键词,见上方说明,区别是全局关键词会每个表对象中没有时自动放入,作为默认值。
① "tag":"Table",后面的 tag 是非 GET、HEAD 请求中匹配请求的 JSON 结构的标识,一般是要查询的 Table 的名称或该名称对应的数组 Table[] 或 Table:[],由后端 Request 表中指定。
② "version":1,接口版本,version 不传、为 null 或 <=0 都会使用最高版本,传了其它有效值则会使用最接近它的最低版本,由后端 Request 表中指定。
③ "format":true,格式化返回 Response JSON 的 key,一般是将 TableName 转为 tableName, TableName[] 转为 tableNameList, Table:alias 转为 alias, TableName-key[] 转为 tableNameKeyList 等小驼峰格式。 | ① 查隐私信息:
[{"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
② 使用第 1 版接口查隐私信息:
[{"version":1,"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22version%22:1,%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
③ 格式化朋友圈接口返回 JSON 中的 key:
[{
"format":true,
"[]":{
"page":0,
"count":3,
"Moment":{},
"User":{
"id@":"/Moment/userId"
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"format":true,"[]":{"page":0,"count":3,"Moment":{},"User":{"id@":"%252FMoment%252FuserId"},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
+
diff --git a/Document-English.md b/Document-English.md
deleted file mode 100644
index 62f40b0a..00000000
--- a/Document-English.md
+++ /dev/null
@@ -1,336 +0,0 @@
-### Examples:
-
-#### Get a User
-Request:
-
-
-[Click here to test](http://apijson.cn:8080/get/{"User":{}})
-
-Response:
-{
- "User":{
- }
-}
-
-
-{
- "User":{
- "id":38710,
- "sex":0,
- "name":"TommyLemon",
- "certified":true,
- "tag":"Android&Java",
- "phone":13000038710,
- "head":"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
- "date":1485948110000,
- "pictureList":[
- "http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
- "http://common.cnblogs.com/images/icon_weibo_24.png"
- ]
- },
- "code":200,
- "msg":"success"
-}
-
-
-
-
-[Click here to test](http://apijson.cn:8080/get/{"[]":{"count":3,"User":{"@column":"id,name"}}})
-
-Response:
-{
- "[]":{
- "count":3, //just get 3 results
- "User":{
- "@column":"id,name" //just get ids and names
- }
- }
-}
-
-
-{
- "[]":[
- {
- "User":{
- "id":38710,
- "name":"TommyLemon"
- }
- },
- {
- "User":{
- "id":70793,
- "name":"Strong"
- }
- },
- {
- "User":{
- "id":82001,
- "name":"Android"
- }
- }
- ],
- "code":200,
- "msg":"success"
-}
-
-
-
-
-
-
-
-#### Get a Moment and its publisher
-Request:
-
-
-[Click here to test](http://apijson.cn:8080/get/{"Moment":{},"User":{"id@":"Moment%252FuserId"}})
-
-Response:
-{
- "Moment":{
- },
- "User":{
- "id@":"Moment/userId" //User.id = Moment.userId
- }
-}
-
-
-{
- "Moment":{
- "id":12,
- "userId":70793,
- "date":"2017-02-08 16:06:11.0",
- "content":"1111534034"
- },
- "User":{
- "id":70793,
- "sex":0,
- "name":"Strong",
- "tag":"djdj",
- "head":"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000",
- "contactIdList":[
- 38710,
- 82002
- ],
- "date":"2017-02-01 19:21:50.0"
- },
- "code":200,
- "msg":"success"
-}
-
-
-#### Get a Moment list like Twitter tweets
-Request:
-
-
-[Click here to test](http://apijson.cn:8080/get/{"[]":{"page":0,"count":2,"Moment":{"content$":"%2525a%2525"},"User":{"id@":"%252FMoment%252FuserId","@column":"id,name,head"},"Comment[]":{"count":2,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
-
-Response:
-{
- "[]":{ //get an array
- "page":0, //pagination
- "count":2,
- "Moment":{ //get a Moment
- "content$":"%a%" //filter condition: content contains 'a'
- },
- "User":{
- "id@":"/Moment/userId", //User.id = Moment.userId, short reference path,starts from grandparents path
- "@column":"id,name,head" //get specified keys with the written order
- },
- "Comment[]":{ //get a Comment array, and unwrap Comment object
- "count":2,
- "Comment":{
- "momentId@":"[]/Moment/id" //Comment.momentId = Moment.id, full reference path
- }
- }
- }
-}
-
-
-
-
-
-
-{
- "[]":[
- {
- "Moment":{
- "id":15,
- "userId":70793,
- "date":1486541171000,
- "content":"APIJSON is a JSON Transmission Protocol…",
- "praiseUserIdList":[
- 82055,
- 82002,
- 82001
- ],
- "pictureList":[
- "http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
- "http://common.cnblogs.com/images/icon_weibo_24.png"
- ]
- },
- "User":{
- "id":70793,
- "name":"Strong",
- "head":"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000"
- },
- "Comment[]":[
- {
- "id":176,
- "toId":166,
- "userId":38710,
- "momentId":15,
- "date":1490444883000,
- "content":"thank you"
- },
- {
- "id":1490863469638,
- "toId":0,
- "userId":82002,
- "momentId":15,
- "date":1490863469000,
- "content":"Just do it"
- }
- ]
- },
- {
- "Moment":{
- "id":58,
- "userId":90814,
- "date":1485947671000,
- "content":"This is a Content...-435",
- "praiseUserIdList":[
- 38710,
- 82003,
- 82005,
- 93793,
- 82006,
- 82044,
- 82001
- ],
- "pictureList":[
- "http://static.oschina.net/uploads/img/201604/22172507_aMmH.jpg"
- ]
- },
- "User":{
- "id":90814,
- "name":7,
- "head":"http://static.oschina.net/uploads/user/51/102723_50.jpg?t=1449212504000"
- },
- "Comment[]":[
- {
- "id":13,
- "toId":0,
- "userId":82005,
- "momentId":58,
- "date":1485948050000,
- "content":"This is a Content...-13"
- },
- {
- "id":77,
- "toId":13,
- "userId":93793,
- "momentId":58,
- "date":1485948050000,
- "content":"This is a Content...-77"
- }
- ]
- }
- ],
- "code":200,
- "msg":"success"
-}
-
-
-
-
-
-
-
-
-[Test it online](http://apijson.cn/api)
-
-
-
-
-## API Design Rules
-
-### 1. Methods and API endpoints
-
- Methods | URL | Request | Response
------------- | ------------ | ------------ | ------------
-**GET**:
A general way to get data.
You can use dev tools to make edits in a web browser. | base_url/get/ | {
TableName:{
//Add contiditions here.
}
}
Eg. To get a Moment with `id = 235`:
{
"Moment":{
"id":235
}
} | {
TableName:{
...
},
"code":200,
"msg":"success"
}
Eg.
{
"Moment":{
"id":235,
"userId":38710,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"code":200,
"msg":"success"
}
-**HEAD**:
A general way to get counts.
You can use dev tools to make edits in a web browser. | base_url/head/ | {
TableName:{
…
}
}
{…} are conditions.
Eg. Get the number of Moments posted by the user with `id = 38710`:
{
"Moment":{
"userId":38710
}
} | {
TableName:{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
Eg.
{
"Moment":{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
-**GETS**:
Get data with high security and confidentiality.
Eg. bank accounts, birth date. | base_url/gets/ | You need to add `"tag":tag` with the same level of `Moment:{}`. Others are the same as **GET**. | Same as **GET**.
-**HEADS**:
Get counts of confidential data(eg. bank account).| base_url/heads/ | You need to add `"tag":tag` with the same level of `Moment:{}`. Others are the same as **HEAD**. | Same as **HEAD**.
-**POST**:
Add new data. | base_url/post/ | {
TableName:{
…
},
"tag":tag
}
The id in {...} is generated automatically when table is built and can’t be set by the user.
Eg. A user with `id = 38710` posts a new Moment:
{
"Moment":{
"userId":38710,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Moment"
} | {
TableName:{
"code":200,
"msg":"success",
"id":38710
},
"code":200,
"msg":"success"
}
Eg.
{
"Moment":{
"code":200,
"msg":"success",
"id":120
},
"code":200,
"msg":"success"
}
-**PUT**:
Make changes to a specific item.
Only change the part sent to server. | base_url/put/ | {
TableName:{
"id":id,
…
},
"tag":tag
}
You can also add multiple id as `id{}`.
Eg. Make changes to Moment's content with id= 235:
{
"Moment":{
"id":235,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Moment"
} | Same as **POST**.
-**DELETE**:
Delete data. | base_url/delete/ | {
TableName:{
"id":id
},
"tag":tag
}
You can also add multiple id as `id{}`.
Or Delete contents with multiple id:
{
"Comment":{
"id{}":[100,110,120]
},
"tag":"Comment[]"
} | {
TableName:{
"code":200,
"msg":"success",
"id[]":[100,110,120]
"count":3
},
"code":200,
"msg":"success"
}
Eg.
{
"Comment":{
"code":200,
"msg":"success",
"id[]":[100,110,120],
"count":3
},
"code":200,
"msg":"success"
}
-
-**Note**:
-1. TableName means the name of the table where you get data. It’ll respond with a JSON Object(the form is {....})with columns inside.
-2. `"tag":tag` is needed when methods are not GET or HEAD. The tag after the colon is the key in JSON Object of making requests. Generally, it’s the name of the table you’re looking for.
-3. GET, HEAD are methods for general data requests.They support versatile JSON Object structure. Other methods are used for requesting confidential data and the requesting JSON Object needs to be in the same form/order as that in the database. Otherwise, the request shall be denied.
-4. GETS and GET, HEADS and HEAD return the same type of data. But the request form is a little different.
-5. For HTTP, all API methods (get,gets,head,heads,post,put,delete) make requests with HTTP POST.
-6. All JSON Objects here are with {...} form. You can put items or objects in it.
-7. Each object in the database has a unique address.
-
-
-
-### 2. Keyswords in URL parameters
-
- Functions | Key-value pairs | Examples
------------- | ------------ | ------------
- Get data in arrays | `"key[]":{}`
The part after the colon is a JSONObject. *key* is optional. When *key* is the same as the table name , the JSONObject will be in a simplified form. For example, `{Table:{Content}}` will be written as `{Content}`.| [{"User[]":{"User":{}}}](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{}}})
It is used for getting data from a user. Here, key and tablename are all "User", then
`{"User":{"id", ...}}`
will be written as
`{"id", ...}`
- Get data that meets specific conditions | `"key{}":[]`
The part after the colon is a JSONArray with conditions inside.| ["id{}":[38710,82001,70793]](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":[38710,82001,70793]}}})
In SQL, this would be `id IN(38710,82001,70793)`.
It means getting data with id equals 38710,82001,70793.
- Get data with comparison operation| `"key{}":"condition0,condition1..."`
Conditions can be any SQL comparision operation. Use''to include any non-number characters.| ["id{}":"<=80000,\>90000"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":"<=80000,\>90000"}}})
In SQL, it'd be
`id<=80000 OR id>90000`,
which means get User array with id\<=80000 \| id>90000
- Get data that contains an element | `"key<>":Object` => `"key<>":[Object]`
*key* must be a JSONArray while *Object* cannot be JSON.| ["contactIdList<\>":38710](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"contactIdList<\>":38710}}})
In SQL, this would be
`json_contains(contactIdList,38710)`.
It means find data of the User whose contactList contains 38710.
- See if it exists |`"key}{@":{`
`"from":"Table",`
`"Table":{ ... }`
`}`
}{ means EXISTS.
*key* is the one you want to check.
Here is a *Subquery* in it, see specifications below for more information. | ["id}{@":{
"from":"Comment",
"Comment":{
"momentId":15
}
}](http://apijson.cn:8080/get/{"User":{"id}{@":{"from":"Comment","Comment":{"momentId":15}}}})
WHERE EXISTS(SELECT * FROM Comment WHERE momentId=15)
- Include functions in parameters | `"key()":"function (key0,key1...)"`
This will trigger the back-end
`function(JSONObject request, String key0, String key1...)`
to get or testify data.
Use - and + to show the order of priority: analyze key-() > analyze the current object > analyze key() > analyze child object > analyze key+()| ["isPraised()":"isContain(praiseUserIdList,userId)"](http://apijson.cn:8080/get/{"Moment":{"id":301,"isPraised()":"isContain(praiseUserIdList,userId)"}})
This will use function boolean isContain(JSONObject request, String array, String value). In this case, client will get "isPraised":true(In this case, client use function to testify if a user clicked ‘like’ button for a Moment.)
- Refer a value | `"key@":"key0/key1/.../refKey"`
Use / to show path. The part before the colon is the key that wants to refer. The path after the colon starts with the parent level of the key.| ["Moment":{
"userId":38710
},
"User":{
"id@":"/Moment/userId"
}](http://apijson.cn:8080/get/{"Moment":{"userId":38710},"User":{"id@":"%252FMoment%252FuserId"}})
In this example, the value of id in User refer to the *userId* in *Moment*, which means
`User.id = Moment.userId`.
After the request is sent,
`"id@":"/Moment/userId"` will be `"id":38710`.
- Subquery | `"key@":{`
`"range":"ALL",`
`"from":"Table",`
`"Table":{ ... }`
`}`
*range* can be ALL, ANY.
*from* means which table you want to query.
It’s very similar to how you query in SQL.
You can also use *count*, *join*, etc. | ["id@":{
"from":"Comment",
"Comment":{
"@column":"min(userId)"
}
}](http://apijson.cn:8080/get/{"User":{"id@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}})
`WHERE id=(SELECT min(userId) FROM Comment)`.
- Fuzzy matching | `"key$":"SQL search expressions"` => `"key$":["SQL search expressions"]`
Any SQL search expressions.Eg.%key%(include key), key%(start with key),%k%e%y%(include k, e, y). % means any characters. | ["name$":"%m%"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name$":"%2525m%2525"}}})
In SQL, it's
`name LIKE '%m%'`,
meaning that get User with ‘m’ in name.
- Regular Expression| `"key~":"regular expression"` => `"key~":["regular expression"]`
It can be any regular expressions.Eg. ^[0-9]+$ ,*~ not case sensitive, advanced search is applicable.| ["name~":"^[0-9]+$"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name~":"^[0-9]%252B$"}}})
In SQL, it's
`name REGEXP '^[0-9]+$'`.
- Get data in a range| `"key%":"start,end"` => `"key%":["start,end"]`
The data type of start and end can only be either Boolean, Number or String. Eg. "2017-01-01,2019-01-01" ,["1,90000", "82001,100000"]. It's used for getting data from a specific time range. | ["date%":"2017-10-01,2018-10-01"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"date%2525":"2017-10-01,2018-10-01"}}})
In SQL, it's
`date BETWEEN '2017-10-01' AND '2018-10-01'`,
meaning to get User data that registered between 2017-10-01 and 2018-10-01.
- Make an alias | `"name:alias"`
this changes name to alias in returning results. It’s applicable to column, tableName, SQL Functions, etc. but only in GET, HEAD requests. | ["@column":"toId:parentId"](http://apijson.cn:8080/get/{"Comment":{"@column":"id,toId:parentId","id":51}})
In SQL, it's
`toId AS parentId`.
It'll return `parentId` instead of `toId`.
For @key format like "lc_wai6b3vk2:(lc_wai6b3vk)", it means renaming field lc_wai6b3vk2 to lc_wai6b3vk, commonly used for field renaming scenarios. Example:
{
"lc_sinan_ba074fbb": {
"lc_wai6b3vk": "11",
"lc_wai6b3vk2": "22",
"@combine": "lc_wai6b3vk \\| lc_wai6b3vk2",
"@key": "lc_wai6b3vk2:(lc_wai6b3vk)"
}
}
corresponds to SQL `(lc_wai6b3vk = '11' OR lc_wai6b3vk2 = '22')`, but the lc_wai6b3vk2 field will be renamed and displayed as lc_wai6b3vk in the returned result
- Add / expand an item | `"key+":Object`
The type of Object is decided by *key*. Types can be Number, String, JSONArray. Froms are 82001,"apijson",["url0","url1"] respectively. It’s only applicable to PUT request.| "praiseUserIdList+":[82001]. In SQL, it's
`json_insert(praiseUserIdList,82001)`.
Add an *id* that praised the Moment.
- Delete / decrease an item | `"Key-":Object`
It’s the contrary of "key+" | "balance-":100.00. In SQL, it's
`balance = balance - 100.00`,
meaning there's 100 less in balance.
- Operations | &, \|, !
They're used in logic operations. It’s the same as AND, OR, NOT in SQL respectively.
By default, for the same key, it’s ‘\|’ (OR)operation among conditions; for different keys, the default operation among conditions is ‘&’(AND).
| ① ["id&{}":">80000,<=90000"](http://apijson.cn:8080/head/{"User":{"id&{}":">80000,<=90000"}})
In SQL, it's
`id>80000 AND id<=90000`,
meaning *id* needs to be id>80000 & id<=90000
② ["id\|{}":">90000,<=80000"](http://apijson.cn:8080/head/{"User":{"id\|{}":">90000,<=80000"}})
It's the same as "id{}":">90000,<=80000".
In SQL, it's
`id>80000 OR id<=90000`,
meaning that *id* needs to be id>90000 \| id<=80000
③ ["id!{}":[82001,38710]](http://apijson.cn:8080/head/{"User":{"id!{}":[82001,38710]}})
In SQL, it's
`id NOT IN(82001,38710)`,
meaning id needs to be ! (id=82001 \| id=38710).
- Keywords in an Array: It can be self-defined. | As for `"key":Object`, *key* is the keyword of *{}* in *"[]":{}*. The type of *Object* is up to *key*.
① `"count":Integer` It's used to count the number. The default largest number is 100.
② `"page":Integer` It’s used for getting data from which page, starting from 0. The default largest number is 100. It’s usually used with COUNT.
③ `"query":Integer` Get the number of items that match conditions
When to get the object, the integer should be 0; when to get the total number, it’s 1; when both above, it’s 2.
You can get the total number with keyword total. It can be referred to other values.
Eg.
`"total@":"/[]/total"`
Put it as the same level of query.
*Query* and *total* are used in GET requests just for convenience. Generally, HEAD request is for getting numbers like the total number.
④ `"join":"&/Table0,Join tables:
"\<" - LEFT JOIN
">" - RIGHT JOIN
"&" - INNER JOIN
"\|" - FULL JOIN
"!" - OUTER JOIN
"@" - APP JOIN
Where @ APP JOIN is in application layer.It’ll get all the keys in tables that refKeys in result tables are referred to, like refKeys:[value0, value1….]. Then, as the results get data according to `key=$refKey` a number of times (COUNT), it uses key `IN($refKeys)` to put these counts together in just one SQL query, in order to improve the performance.
Other JOIN functions are the same as those in SQL.
`"join":"`"MainTable":{},`
`"ViceTable":{"key@":"/MainTable/refKey"}`
will return
`MainTable LEFT JOIN ViceTable`
`ON ViceTable.key=MainTable.refKey`
⑤ `"otherKey":Object` Self-defined keyword other than those that already in the system. It also returns with self-defined keywords.| ① Get User arrays with maximum of 5:
["count":5](http://apijson.cn:8080/get/{"[]":{"count":5,"User":{}}})
② Look into User arrays on page 3. Show 5 of them each page.
["count":5,
"page":3](http://apijson.cn:8080/get/{"[]":{"count":5,"page":3,"User":{}}})
③ Get User Arrays and count the total number of Users:
["[]":{
"query":2,
"User":{}
},
"total@":"/[]/total"](http://apijson.cn:8080/get/{"[]":{"query":2,"count":5,"User":{}},"total@":"%252F[]%252Ftotal"})
Questions like total page numbers or if there's next page can be solved by total,count,page functions,
Total page number:
`int totalPage = Math.ceil(total / count)`
If this is the last page:
`boolean hasNextPage = total > count*page`
If this is the first page:
`boolean isFirstPage = page <= 0`
If it's the last page:
`boolean isLastPage = total <= count*page`
...
④ Moment INNER JOIN User LEFT JOIN Comment:
["[]":{
"join": "&/User,\ "Moment":{},
"User":{
"name~":"t",
"id@": "/Moment/userId"
},
"Comment":{
"momentId@": "/Moment/id"
}
}](http://apijson.cn:8080/get/{"[]":{"count":5,"join":"&%252FUser,\<%252FComment","Moment":{"@column":"id,userId,content"},"User":{"name~":"t","id@":"%252FMoment%252FuserId","@column":"id,name,head"},"Comment":{"momentId@":"%252FMoment%252Fid","@column":"id,momentId,content"}}})
⑤ Add the current user to every level:
["User":{},
"[]":{
"name@":"User/name", //self-defined keyword
"Moment":{}
}](http://apijson.cn:8080/get/{"User":{},"[]":{"name@":"User%252Fname","Moment":{}}})
- Keywords in Objects: It can be self-defined. | `"@key":Object` @key is the keyword of {} in Table:{}. The type of Object is decided by @key
① `"@combine":"&key0,&key1,\|key2,key3,`
`!key4,!key5,&key6,key7..."`
First, it’ll group data with same operators. Within one group, it operates from left to right. Then it’ll follow the order of & \| ! to do the operation. Different groups are connected with &. So the expression above will be :
(key0 & key1 & key6 & other key) & (key2 \| key3 \| key7) & !(key4 \| key5)
\| is optional.
② `"@column":"column;function(arg)..."` Return with specific columns.
③ `"@order":"column0+,column1-..."` Decide the order of returning results:
④ `"@group":"column0,column1..."` How to group data. If @column has declared Table id, this id need to be included in @group. In other situations, at least one of the following needs to be done:
1.Group id is declared in @column
2.Primary Key of the table is declared in @group.
⑤ `@having":"function0(...)?value0;function1(...)?value1;function2(...)?value2..."` Add conditions on return results with @having. Usually working with@group, it’s declared in @column.
⑥ `"@schema":"sys"` Can be set as default setting.
⑦ `"@database":"POSTGRESQL"` Get data from a different database.Can be set as default setting.
⑧ `"@role":"OWNER"` Get information of the user, including
UNKNOWN,LOGIN,CONTACT,CIRCLE,OWNER,ADMIN,
Can be set as default setting.
You can self-define a new role or rewrite a role. Use`Verifier.verify` etc. to self-define validation methods.
⑨ `"@explain":true` Profiling. Can be set as default setting.
⑩ `"@otherKey":Object` Self-define keyword | ① Search *Users* that *name* or *tag* contains the letter "a":
["name~":"a",
"tag~":"a",
"@combine":"name~,tag~"](http://apijson.cn:8080/get/{"User[]":{"count":10,"User":{"@column":"id,name,tag","name~":"a","tag~":"a","@combine":"name~,tag~"}}})
② Only search column id,sex,name and return with the same order:
["@column":"id,sex,name"](http://apijson.cn:8080/get/{"User":{"@column":"id,sex,name","id":38710}})
③ Search Users that have descending order of name and default order of id:
["@order":"name-,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"User":{"@column":"name,id","@order":"name-,id"}}})
④ Search Moment grouped with userId:
["@group":"userId,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})
⑤ Search Moments that id equals or less than 100 and group with userId:
["@column":"userId;max(id)",
"@group":"userId",
"@having":"max(id)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id)","@group":"userId","@having":"max(id)>=100"}}})
You can also define the name of the returned function:
["@column":"userId;max(id):maxId",
"@group":"userId",
"@having":"(maxId)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id):maxId","@group":"userId","@having":"(maxId)>=100"}}})
⑥ Check Users table in sys:
["@schema":"sys"](http://apijson.cn:8080/get/{"User":{"@schema":"sys"}})
⑦ Check Users table in PostgreSQL:
["@database":"POSTGRESQL"](http://apijson.cn:8080/get/{"User":{"@database":"POSTGRESQL"}})
⑧ Check the current user's activity:
["@role":"OWNER"](http://apijson.cn:8080/get/{"[]":{"Moment":{"@role":"OWNER"}}})
⑨ Turn on profiling:
["@explain":true](http://apijson.cn:8080/get/{"[]":{"Moment":{"@explain":true}}})
⑩ Get the No.0 picture from pictureList:
["@position":0, //self-defined keyword
"firstPicture()":"getFromArray(pictureList,@position)"](http://apijson.cn:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"getFromArray(pictureList,@position)"}})
- global keyword. | It is a keyword inside the outermost object {}. Among them, @database, @schema, @datasource, @role, and @explain are basically the same as object keywords, see the above description, the difference is that the global keywords will be automatically inserted in each table object as the default value.
① "tag": String, the following tag is the identifier of the JSON structure matching the request in non-GET or HEAD requests, generally it is the name of the Table to be queried or the array Table[] or Table:[] corresponding to the name, determined by the backend specified in the Request table.
② "version": Integer, the interface version. If the version is not passed, null or <=0, the highest version will be used. If other valid values are passed, the lowest version closest to it will be used, which is specified in the backend Request table.
③ "format": Boolean, formatted to return the key of the Response JSON, generally converting TableName to tableName, TableName[] to tableNameList, Table:alias to alias, TableName-key[] to tableNameKeyList and other camelcase formats. | ① Check private information::
[{"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
② Use the version 1 interface to check private information::
[{"version":1,"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22version%22:1,%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
③ Format Moments interface to return in JSON key:
[{
"format":true,
"[]":{
"page":0,
"count":3,
"Moment":{},
"User":{
"id@":"/Moment/userId"
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"format":true,"[]":{"page":0,"count":3,"Moment":{},"User":{"id@":"%252FMoment%252FuserId"},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
-
-
-
diff --git a/Document.md b/Document.md
index 11db6fe8..253fb6cb 100644
--- a/Document.md
+++ b/Document.md
@@ -1,48 +1,24 @@
-[English](https://github.com/Tencent/APIJSON/blob/master/Document-English.md)
-
-
-# APIJSON 通用文档
-本文是通用文档,只和 APIJSON 协议有关,和 C#, Go, Java, JavaScript, PHP, Python, TypeScript 等开发语言无关。
-具体开发语言相关的 配置、运行、部署 等文档见各个相关项目的文档,可以在首页点击对应语言的入口来查看。
-https://github.com/Tencent/APIJSON
-
-
-
-后端开发者可以先看 [图文入门教程1](http://apijson.cn/doc/zh/) 或 [图文入门教程2](https://hanxu2018.github.io/APIJSON-DOC/) (和本文档有出入的点以本文档为准。例如正则匹配 key? 已废弃,用 key~ 替代;例如 "@column":"store_id,sum(amt):totAmt" 中逗号 , 有误,应该用分号 ; 隔开 SQL 函数,改为 "@column":"store_id;sum(amt):totAmt")
-
-* ### [1.示例](#1)
-* ### [2.对比传统方式](#2)
-* [2.1 开发流程](#2.1)
-* [2.2 前端请求](#2.2)
-* [2.3 后端操作](#2.3)
-* [2.4 前端解析](#2.4)
-* [2.5 对应不同需求的请求](#2.5)
-* [2.6 对应不同请求的结果](#2.6)
-* ### [3.设计规范](#3)
-* [3.1 操作方法](#3.1)
-* [3.2 功能符](#3.2)
+### Examples:
-
-## 1.示例
-
-#### 获取用户
-请求:
+#### Get a User
+Request:
-[点击这里测试](http://apijson.cn:8080/get/{"User":{"id":38710}})
+[Click here to test](http://apijson.cn:8080/get/{"User":{}})
-返回:
+Response:
{
"User":{
- "id":38710
}
}
+{
"User":{
"id":38710,
"sex":0,
"name":"TommyLemon",
+ "certified":true,
"tag":"Android&Java",
+ "phone":13000038710,
"head":"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
"date":1485948110000,
"pictureList":[
@@ -55,29 +31,30 @@ https://github.com/Tencent/APIJSON
}
+
-#### 获取用户列表
-请求:
+#### Get an array of Users
+
+Request:
-[点击这里测试](http://apijson.cn:8080/get/{"[]":{"count":3,"User":{"@column":"id,name"}}})
+[Click here to test](http://apijson.cn:8080/get/{"[]":{"count":3,"User":{"@column":"id,name"}}})
-返回:
+Response:
{
"[]":{
- "count":3, //只要3个
+ "count":3, //just get 3 results
"User":{
- "@column":"id,name" //只要id,name这两个字段
+ "@column":"id,name" //just get ids and names
}
}
}
+{
"[]":[
{
@@ -104,16 +81,17 @@ https://github.com/Tencent/APIJSON
}
+
-#### 获取动态及发布者用户
-请求:
+#### Get a Moment and its publisher
+Request:
-[点击这里测试](http://apijson.cn:8080/get/{"Moment":{},"User":{"id@":"Moment%252FuserId"}})
+[Click here to test](http://apijson.cn:8080/get/{"Moment":{},"User":{"id@":"Moment%252FuserId"}})
-返回:
+Response:
{
"Moment":{
},
@@ -123,9 +101,9 @@ https://github.com/Tencent/APIJSON
}
{
"Moment":{
"id":12,
@@ -152,32 +130,32 @@ https://github.com/Tencent/APIJSON
-#### 获取类似微信朋友圈的动态列表
-请求:
+#### Get a Moment list like Twitter tweets
+Request:
-[点击这里测试](http://apijson.cn:8080/get/{"[]":{"page":0,"count":2,"Moment":{"content$":"%2525a%2525"},"User":{"id@":"%252FMoment%252FuserId","@column":"id,name,head"},"Comment[]":{"count":2,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
+[Click here to test](http://apijson.cn:8080/get/{"[]":{"page":0,"count":2,"Moment":{"content$":"%2525a%2525"},"User":{"id@":"%252FMoment%252FuserId","@column":"id,name,head"},"Comment[]":{"count":2,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
-返回:
+Response:
{
- "[]":{ //请求一个数组
- "page":0, //数组条件
+ "[]":{ //get an array
+ "page":0, //pagination
"count":2,
- "Moment":{ //请求一个名为Moment的对象
- "content$":"%a%" //对象条件,搜索content中包含a的动态
+ "Moment":{ //get a Moment
+ "content$":"%a%" //filter condition: content contains 'a'
},
"User":{
- "id@":"/Moment/userId", //User.id = Moment.userId 缺省引用赋值路径,从所处容器的父容器路径开始
- "@column":"id,name,head" //指定返回字段
+ "id@":"/Moment/userId", //User.id = Moment.userId, short reference path,starts from grandparents path
+ "@column":"id,name,head" //get specified keys with the written order
},
- "Comment[]":{ //请求一个名为Comment的数组,并去除Comment包装
+ "Comment[]":{ //get a Comment array, and unwrap Comment object
"count":2,
"Comment":{
- "momentId@":"[]/Moment/id" //Comment.momentId = Moment.id 完整引用赋值路径
+ "momentId@":"[]/Moment/id" //Comment.momentId = Moment.id, full reference path
}
}
}
}
{
"[]":[
{
@@ -270,7 +248,7 @@ https://github.com/Tencent/APIJSON
-[在线测试](http://apijson.cn/api)
+[Test it online](http://apijson.cn/api)
-
-## 2.对比传统RESTful方式
-###
2.1 开发流程
- 开发流程 | 传统方式 | APIJSON
--------- | ------------ | ------------
- 接口传输 | 等后端编辑接口,然后更新文档,前端再按照文档编辑请求和解析代码 | 前端按照自己的需求编辑请求和解析代码。
没有接口,更不需要文档!前端再也不用和后端沟通接口或文档问题了!
- 兼容旧版 | 后端增加新接口,用v2表示第2版接口,然后更新文档 | 什么都不用做!
-
-
-
-### 2.2 前端请求
- 前端请求 | 传统方式 | APIJSON
--------- | ------------ | ------------
- 要求 | 前端按照文档在对应URL后面拼接键值对 | 前端按照自己的需求在固定URL后拼接JSON
- URL | 不同的请求对应不同的URL,基本上有多少个不同的请求就得有多少个接口URL | 相同的操作方法(增删改查)都用同一个URL,
大部分请求都用7个通用接口URL的其中一个
- 键值对 | key=value | key:value
- 结构 | 同一个URL内table_name只能有一个
base_url/get/table_name?
key0=value0&key1=value1... | 同一个URL后TableName可传任意数量个
base_url/get/
{
TableName0:{
key0:value0,
key1:value1,
...
},
TableName1:{
...
}
...
}
-
-
-
-### 2.3 后端操作
- 后端操作 | 传统方式 | APIJSON
--------- | ------------ | ------------
- 解析和返回 | 取出键值对,把键值对作为条件用预设的的方式去查询数据库,最后封装JSON并返回给前端 | 把Parser#parse方法的返回值返回给前端就行
- 返回JSON结构的设定方式 | 由后端设定,前端不能修改 | 由前端设定,后端不能修改
-
-
-
-### 2.4 前端解析
- 前端解析 | 传统方式 | APIJSON
--------- | ------------ | ------------
- 查看方式 | 查文档或问后端,或等请求成功后看日志 | 看请求就行,所求即所得,不用查、不用问、不用等。也可以等请求成功后看日志
- 解析方法 | 用JSON解析器来解析JSONObject | 可以用JSONResponse解析JSONObject,或使用传统方式
-
-
-
-### 2.5 前端对应不同需求的请求
- 前端的请求 | 传统方式 | APIJSON
--------- | ------------ | ------------
- User | base_url/get/user?id=38710 | [base_url/get/
{
"User":{
"id":38710
}
}](http://apijson.cn:8080/get/{"User":{"id":38710}})
- Moment和对应的User | 分两次请求
Moment:
base_url/get/moment?userId=38710
User:
base_url/get/user?id=38710 | [base_url/get/
{
"Moment":{
"userId":38710
},
"User":{
"id":38710
}
}](http://apijson.cn:8080/get/{"Moment":{"userId":38710},"User":{"id":38710}})
- User列表 | base_url/get/user/list?
page=0&count=3&sex=0 | [base_url/get/
{
"User[]":{
"page":0,
"count":3,
"User":{
"sex":0
}
}
}](http://apijson.cn:8080/get/{"User[]":{"page":0,"count":3,"User":{"sex":0}}})
- Moment列表,
每个Moment包括
1.发布者User
2.前3条Comment | Moment里必须有
1.User对象
2.Comment数组
base_url/get/moment/list?
page=0&count=3&commentCount=3 | [base_url/get/
{
"[]":{
"page":0,
"count":3,
"Moment":{},
"User":{
"id@":"/Moment/userId"
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"[]":{"page":0,"count":3,"Moment":{},"User":{"id@":"%252FMoment%252FuserId"},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
- User发布的Moment列表,
每个Moment包括
1.发布者User
2.前3条Comment | 1.Moment里必须有User对象和Comment数组
2.字段名必须查接口文档,例如评论数量字段名可能是
commentCount,comment_count或者简写cmt_count等各种奇葩写法...
base_url/get/moment/list?
page=0&count=3
&commentCount=3&userId=38710 | 有以下几种方式:
① 把以上请求里的
"Moment":{}, "User":{"id@":"/Moment/userId"}
改为
["Moment":{"userId":38710}, "User":{"id":38710}](http://apijson.cn:8080/get/{"[]":{"page":0,"count":3,"Moment":{"userId":38710},"User":{"id":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
② 或把User放在上面的最外层省去重复的User
[base_url/get/
{
"User":{
"id":38710
},
"[]":{
"page":0,
"count":3,
"Moment":{
"userId":38710
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"User":{"id":38710},"[]":{"page":0,"count":3,"Moment":{"userId":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
③ 如果User之前已经获取到了,还可以不传User来节省请求和返回数据的流量并提升速度
[base_url/get/
{
"[]":{
"page":0,
"count":3,
"Moment":{
"userId":38710
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"[]":{"page":0,"count":3,"Moment":{"userId":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
-
-
-
-### 2.6 后端对应不同请求的返回结果
- 后端的返回结果 | 传统方式 | APIJSON
--------- | ------------ | ------------
- User | {
"data":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
} | {
"User":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
}
- Moment和对应的User | 分别返回两次请求的结果,获取到Moment后取出userId作为User的id条件去查询User
Moment:
{
"data":{
"id":235,
"content":"xxx",
...
},
"code":200,
"msg":"success"
}
User:
{
"data":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
} | 一次性返回,没有传统方式导致的 长时间等待结果、两次结果间关联、线程多次切换 等问题
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"User":{
"id":38710,
"name":"xxx",
...
},
"code":200,
"msg":"success"
}
- User列表 | {
"data":[
{
"id":38710,
"name":"xxx",
...
},
{
"id":82001,
...
},
...
],
"code":200,
"msg":"success"
} | {
"User[]":[
{
"id":38710,
"name":"xxx",
...
},
{
"id":82001,
...
},
...
],
"code":200,
"msg":"success"
}
- Moment列表,每个Moment包括发布者User和前3条Comment | Moment里必须有
1.User对象
2.Comment数组
{
"data":[
{
"id":235,
"content":"xxx",
...,
"User":{
...
},
"Comment":[
...
]
},
{
"id":301,
"content":"xxx",
...,
"User":{
...
},
...
},
...
],
"code":200,
"msg":"success"
} | 1.高灵活,可任意组合
2.低耦合,逻辑很清晰
{
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"User":{
...
},
"Comment[]":[
...
]
},
{
"Moment":{
"id":301,
"content":"xxx",
...
},
"User":{
...
},
...
},
...
],
"code":200,
"msg":"success"
}
- User发布的Moment列表,每个Moment包括发布者User和前3条Comment | 1.大量重复User,浪费流量和服务器性能
2.优化很繁琐,需要后端扩展接口、写好文档,前端/前端再配合优化
{
"data":[
{
"id":235,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
{
"id":470,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
{
"id":511,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
{
"id":595,
"content":"xxx",
...,
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment":[
...
]
...
},
...
],
"code":200,
"msg":"success"
} | 以上不同请求方式的结果:
① 常规请求
{
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"User":{
"id":38710,
"name":"Tommy"
...
},
"Comment[]":[
...
]
},
...
],
"code":200,
"msg":"success"
}
② 省去重复的User
{
"User":{
"id":38710,
"name":"Tommy",
...
},
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"Comment[]":[
...
]
},
...
],
"code":200,
"msg":"success"
}
③ 不查询已获取到的User
{
"[]":[
{
"Moment":{
"id":235,
"content":"xxx",
...
},
"Comment[]":[
...
]
},
...
],
"code":200,
"msg":"success"
}
-
-
-1.base_url指基地址,一般是顶级域名,其它分支url都是在base_url后扩展。如base_url:http://apijson.cn:8080/ ,对应的GET分支url:http://apijson.cn:8080/get/ 。下同。
-2.请求中的key或value任意一个为null值时,这个 key:value键值对 被视为无效。下同。
-3.请求中的 / 需要转义。JSONRequest.java已经用URLEncoder.encode转义,不需要再写;但如果是浏览器或Postman等直接输入url/request,需要把request中的所有 / 都改成 %252F 。下同。
-4.code,指返回结果中的状态码,200表示成功,其它都是错误码,值全部都是HTTP标准状态码。下同。
-5.msg,指返回结果中的状态信息,对成功结果或错误原因的详细说明。下同。
-6.code和msg总是在返回结果的同一层级成对出现。对所有请求的返回结果都会在最外层有一对总结式code和msg。下同。
-7.id等字段对应的值仅供说明,不一定是数据库里存在的,请求里用的是真实存在的值。下同。
+## API Design Rules
-
-
+### 1. Methods and API endpoints
-## 3.设计规范
+ Methods | URL | Request | Response
+------------ | ------------ | ------------ | ------------
+**GET**:
A general way to get data.
You can use dev tools to make edits in a web browser. | base_url/get/ | {
TableName:{
//Add contiditions here.
}
}
Eg. To get a Moment with `id = 235`:
{
"Moment":{
"id":235
}
} | {
TableName:{
...
},
"code":200,
"msg":"success"
}
Eg.
{
"Moment":{
"id":235,
"userId":38710,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"code":200,
"msg":"success"
}
+**HEAD**:
A general way to get counts.
You can use dev tools to make edits in a web browser. | base_url/head/ | {
TableName:{
…
}
}
{…} are conditions.
Eg. Get the number of Moments posted by the user with `id = 38710`:
{
"Moment":{
"userId":38710
}
} | {
TableName:{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
Eg.
{
"Moment":{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
+**GETS**:
Get data with high security and confidentiality.
Eg. bank accounts, birth date. | base_url/gets/ | You need to add `"tag":tag` with the same level of `Moment:{}`. Others are the same as **GET**. | Same as **GET**.
+**HEADS**:
Get counts of confidential data(eg. bank account).| base_url/heads/ | You need to add `"tag":tag` with the same level of `Moment:{}`. Others are the same as **HEAD**. | Same as **HEAD**.
+**POST**:
Add new data. | base_url/post/ | {
TableName:{
…
},
"tag":tag
}
The id in {...} is generated automatically when table is built and can’t be set by the user.
Eg. A user with `id = 38710` posts a new Moment:
{
"Moment":{
"userId":38710,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Moment"
} | {
TableName:{
"code":200,
"msg":"success",
"id":38710
},
"code":200,
"msg":"success"
}
Eg.
{
"Moment":{
"code":200,
"msg":"success",
"id":120
},
"code":200,
"msg":"success"
}
+**PUT**:
Make changes to a specific item.
Only change the part sent to server. | base_url/put/ | {
TableName:{
"id":id,
…
},
"tag":tag
}
You can also add multiple id as `id{}`.
Eg. Make changes to Moment's content with id= 235:
{
"Moment":{
"id":235,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Moment"
} | Same as **POST**.
+**DELETE**:
Delete data. | base_url/delete/ | {
TableName:{
"id":id
},
"tag":tag
}
You can also add multiple id as `id{}`.
Or Delete contents with multiple id:
{
"Comment":{
"id{}":[100,110,120]
},
"tag":"Comment[]"
} | {
TableName:{
"code":200,
"msg":"success",
"id[]":[100,110,120]
"count":3
},
"code":200,
"msg":"success"
}
Eg.
{
"Comment":{
"code":200,
"msg":"success",
"id[]":[100,110,120],
"count":3
},
"code":200,
"msg":"success"
}
+
+**Note**:
+1. TableName means the name of the table where you get data. It’ll respond with a JSON Object(the form is {....})with columns inside.
+2. `"tag":tag` is needed when methods are not GET or HEAD. The tag after the colon is the key in JSON Object of making requests. Generally, it’s the name of the table you’re looking for.
+3. GET, HEAD are methods for general data requests.They support versatile JSON Object structure. Other methods are used for requesting confidential data and the requesting JSON Object needs to be in the same form/order as that in the database. Otherwise, the request shall be denied.
+4. GETS and GET, HEADS and HEAD return the same type of data. But the request form is a little different.
+5. For HTTP, all API methods (get,gets,head,heads,post,put,delete) make requests with HTTP POST.
+6. All JSON Objects here are with {...} form. You can put items or objects in it.
+7. Each object in the database has a unique address.
-### 3.1 操作方法
+
- 方法及说明 | URL | Request | Response
------------- | ------------ | ------------ | ------------
-GET:
普通获取数据,
可用浏览器调试 | base_url/get/ | {
TableName:{
…
}
}
{…}内为限制条件
例如获取一个 id = 235 的 Moment:
[{
"Moment":{
"id":235
}
}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fget&type=JSON&json={"Moment"%3A{"id"%3A235}})
后端校验通过后自动解析为 SQL 并执行:
`SELECT * FROM Moment WHERE id=235 LIMIT 1` | {
TableName:{
...
},
"code":200,
"msg":"success"
}
例如
{
"Moment":{
"id":235,
"userId":38710,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"code":200,
"msg":"success"
}
-HEAD:
普通获取数量,
可用浏览器调试 | base_url/head/ | {
TableName:{
…
}
}
{…}内为限制条件
例如获取一个 id = 38710 的 User 所发布的 Moment 总数:
[{
"Moment":{
"userId":38710
}
}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fhead&type=JSON&json={"Moment"%3A{"userId"%3A38710}})
后端校验通过后自动解析为 SQL 并执行:
`SELECT count(*) FROM Moment WHERE userId=38710 LIMIT 1` | {
TableName:{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
例如
{
"Moment":{
"code":200,
"msg":"success",
"count":10
},
"code":200,
"msg":"success"
}
-GETS:
安全/私密获取数据,
用于获取钱包等
对安全性要求高的数据 | base_url/gets/ | 最外层加一个 "tag":tag,例如 ["tag":"Privacy"](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={"tag"%3A"Privacy","Privacy"%3A{"id"%3A82001}}),其它同GET | 同GET
-HEADS:
安全/私密获取数量,
用于获取银行卡数量等
对安全性要求高的数据总数 | base_url/heads/ | 最外层加一个 "tag":tag,例如 ["tag":"Verify"](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fheads&type=JSON&json={"tag"%3A"Verify","Verify"%3A{"phone"%3A13000082001}}),其它同HEAD | 同HEAD
-POST:
新增数据 | base_url/post/ | 单个:
{
TableName:{
…
},
"tag":tag
}
{…}中id由后端生成,不能传
例如当前登录用户 38710 发布一个新 Comment:
[{
"Comment":{
"momentId":12,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Comment"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fpost&type=JSON&json={"Comment":{"momentId":12,"content":"APIJSON%20is%20the%20Real-Time%20coding-free,%20powerful%20and%20secure%20ORM."},"tag":"Comment"})
后端校验通过后自动解析为 SQL 并执行:
`INSERT INTO Comment(userId,momentId,content) VALUES(38710,12,'APIJSON is the real-time coding-free, powerful and secure ORM')`
批量:
{
TableName\[]:\[{
…
}, {
…
}
…
],
"tag":tag
}
{…}中id由后端生成,不能传
例如当前登录用户 82001 发布 2 个 Comment:
[{
"Comment[]":[{
"momentId":12,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
}, {
"momentId":15,
"content":"APIJSON is a JSON transmision protocol."
}],
"tag":"Comment:[]"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fpost&type=JSON&json={"Comment[]":[{"momentId":12,"content":"APIJSON%20is%20the%20Real-Time%20coding-free,%20powerful%20and%20secure%20ORM."},{"momentId":15,"content":"APIJSON%20is%20a%20JSON%20transmision%20protocol."}],"tag":"Comment:[]"})
后端校验通过后自动解析为 SQL 并执行:
`INSERT INTO Comment(userId,momentId,content) VALUES(82001,12,'APIJSON is the real-time coding-free, powerful and secure ORM');`
`INSERT INTO Comment(userId,momentId,content) VALUES(82001,15,'APIJSON is a JSON transmision protocol.');` | 单个:
{
TableName:{
"code":200,
"msg":"success",
"id":38710
},
"code":200,
"msg":"success"
}
例如
{
"Comment":{
"code":200,
"msg":"success",
"id":120
},
"code":200,
"msg":"success"
}
批量:
{
TableName:{
"code":200,
"msg":"success",
"count":5,
"id[]":[1, 2, 3, 4, 5]
},
"code":200,
"msg":"success"
}
例如
{
"Comment":{
"code":200,
"msg":"success",
"count":2,
"id[]":\[1, 2]
},
"code":200,
"msg":"success"
}
-PUT:
修改数据,
只修改所传的字段 | base_url/put/ | {
TableName:{
"id":id,
…
},
"tag":tag
}
{…} 中 id 或 id{} 至少传一个
例如当前登录用户 82001 修改 id = 235 的 Moment 的 content:
[{
"Moment":{
"id":235,
"content":"APIJSON is the real-time coding-free, powerful and secure ORM"
},
"tag":"Moment"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fput&type=JSON&json={"Moment":{"id":235,"content":"APIJSON%20is%20the%20Real-Time%20coding-free,%20powerful%20and%20secure%20ORM."},"tag":"Moment"})
后端校验通过后自动解析为 SQL 并执行:
`UPDATE Moment SET content='APIJSON is the real-time coding-free, powerful and secure ORM' WHERE id=235 AND userId=82001 LIMIT 1`
批量除了 id{}:\[] 也可类似批量 POST,只是每个 {...} 里面都必须有 id。
"tag":"Comment[]" 对应对象 "Comment":{"id{}":[1,2,3]},表示指定记录全部统一设置;
"tag":"Comment:[]" 多了冒号,对应数组 "Comment[]":[{"id":1},{"id":2},{"id":3}],表示每项单独设置 | 同POST
-DELETE:
删除数据 | base_url/delete/ | {
TableName:{
"id":id
},
"tag":tag
}
{…} 中 id 或 id{} 至少传一个,一般只传 id 或 id{}
例如当前登录用户 82001 批量删除 id = 100,110,120 的 Comment:
[{
"Comment":{
"id{}":[100,110,120]
},
"tag":"Comment[]"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fdelete&type=JSON&json={"Comment":{"id{}":[100,110,120]},"tag":"Comment[]"})
后端校验通过后自动解析为 SQL 并执行:
`DELETE FROM Comment WHERE id IN(100,110,120) AND userId=82001 LIMIT 3` | {
TableName:{
"code":200,
"msg":"success",
"id[]":[100,110,120]
"count":3
},
"code":200,
"msg":"success"
}
例如
{
"Comment":{
"code":200,
"msg":"success",
"id[]":[100,110,120],
"count":3
},
"code":200,
"msg":"success"
}
-以上接口的简单形式:
base_url/{method}/{tag} | GET: 普通获取数据
base_url/get/{tag}
HEAD: 普通获取数量
base_url/head/{tag}
GETS: 安全/私密获取数据
base_url/gets/{tag}
HEADS: 安全/私密获取数量
base_url/heads/{tag}
POST: 新增数据
base_url/post/{tag}
PUT: 修改数据 base_url/put/{tag}
DELETE: 删除数据
base_url/delete/{tag} | 例如安全/私密获取一个 id = 82001 的 Privacy:
[base_url/gets/Privacy/
{"id":82001}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets%2FPrivacy&type=JSON&json={"id"%3A82001})
相当于
[base_url/gets/
{"tag":"Privacy", "Privacy":{"id":82001}}](http://apijson.cn/api/?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={"tag"%3A"Privacy","Privacy"%3A{"id"%3A82001}})
例如批量修改 id = 114, 124 的 Comment 的 content:
[base_url/put/Comemnt[]/
{
"id{}":[114,124],
"content":"test multi put"
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fput%2FComment[]&type=JSON&json={"id{}"%3A[114,124],"content"%3A"test%20multi%20put"})
相当于
[base_url/put/
{
"tag":"Comment[]",
"Comment":{
"id{}":[114,124],
"content":"test multi put"
}
}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fput&type=JSON&json={"tag"%3A"Comment[]","Comment"%3A{"id{}"%3A[114,124],"content"%3A"test%20multi%20put"}}) | 同以上对应的方法
-
-1.TableName指要查询的数据库表Table的名称字符串。第一个字符为大写字母,剩下的字符要符合英语字母、数字、下划线中的任何一种。对应的值的类型为JSONObject,结构是 {...},里面放的是Table的字段(列名)。下同。
-2."tag":tag 后面的tag是非GET、HEAD请求中匹配请求的JSON结构的标识,一般是要查询的Table的名称,由后端Request表中指定。下同。
-3.GET、HEAD请求是开放请求,可任意组合任意嵌套。其它请求为受限制的安全/私密请求,对应的 方法(method), 标识(tag), 版本(version), 结构(structure) 都必须和 后端Request表中所指定的 一一对应,否则请求将不被通过。version 不传、为 null 或 <=0 都会使用最高版本,传了其它有效值则会使用最接近它的最低版本。下同。
-4.GETS与GET、HEADS与HEAD分别为同一类型的操作方法,请求稍有不同但返回结果相同。下同。
-5.在HTTP通信中,自动化接口(get,gets,head,heads,post,put,delete) 全用HTTP POST请求。下同。
-6.所有JSONObject都视为容器(或者文件夹),结构为 {...} ,里面可以放普通对象或子容器。下同。
-7.每个对象都有一个唯一的路径(或者叫地址),假设对象名为refKey,则用 key0/key1/.../refKey 表示。下同。
-
-
-
-### 3.2 功能符
+### 2. Keyswords in URL parameters
- 功能 | 键值对格式 | 使用示例
+ Functions | Key-value pairs | Examples
------------ | ------------ | ------------
- 查询数组 | "key[]":{},后面是 JSONObject,key 可省略。当 key 和里面的 Table 名相同时,Table 会被提取出来,即 {Table:{Content}} 会被转化为 {Content} | [{"User[]":{"User":{}}}](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{}}}),查询一个 User 数组。这里 key 和 Table 名都是 User,User 会被提取出来,即 {"User":{"id", ...}} 会被转化为 {"id", ...},如果要进一步提取 User 中的 id,可以把 User[] 改为 User-id[],其中 - 用来分隔路径中涉及的 key
- 匹配选项范围 | "key{}":[],后面是 JSONArray,作为 key 可取的值的选项 | ["id{}":[38710,82001,70793]](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":[38710,82001,70793]}}}),对应 SQL 是`id IN(38710,82001,70793)`,查询 id 符合 38710,82001,70793 中任意一个的一个 User 数组
- 匹配条件范围 | "key{}":"条件0,条件1...",条件为 SQL 表达式字符串,可进行数字比较运算等 | ["id{}":"<=80000,\>90000"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":"<=80000,\>90000"}}}),对应 SQL 是`id<=80000 OR id>90000`,查询 id 符合 id\<=80000 \| id>90000 的一个 User 数组
- 包含选项范围 | "key<\>":value => "key<\>":[value],key 对应值的类型必须为 JSONArray,value 值类型只能为 Boolean, Number, String 中的一种 | ["contactIdList<\>":38710](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"contactIdList<\>":38710}}}),对应SQL是`json_contains(contactIdList,38710)`,查询 contactIdList 包含 38710 的一个 User 数组
- 判断是否存在 | "key}{@":{
"from":"Table",
"Table":{ ... }
}
其中:
}{ 表示 EXISTS;
key 用来标识是哪个判断;
@ 后面是 子查询 对象,具体见下方 子查询 的说明。 | ["id}{@":{
"from":"Comment",
"Comment":{
"momentId":15
}
}](http://apijson.cn:8080/get/{"User":{"id}{@":{"from":"Comment","Comment":{"momentId":15}}}})
WHERE EXISTS(SELECT * FROM Comment WHERE momentId=15)
- 远程调用函数 | "key()":"函数表达式",函数表达式为 function(key0,key1...),会调用后端对应的函数 function(JSONObject request, String key0, String key1...),实现 参数校验、数值计算、数据同步、消息推送、字段拼接、结构变换 等特定的业务逻辑处理,
可使用 - 和 + 表示优先级,解析 key-() > 解析当前对象 > 解析 key() > 解析子对象 > 解析 key+() | ["isPraised()":"isContain(praiseUserIdList,userId)"](http://apijson.cn:8080/get/{"Moment":{"id":301,"isPraised()":"isContain(praiseUserIdList,userId)"}}),会调用远程函数 [boolean isContain(JSONObject request, String array, String value)](https://github.com/APIJSON/apijson-framework/blob/master/src/main/java/apijson/framework/APIJSONFunctionParser.java#L361-L374) ,然后变为 "isPraised":true 这种(假设点赞用户id列表包含了userId,即这个User点了赞)
- 存储过程 | "@key()":"SQL函数表达式",函数表达式为
function(key0,key1...)
会调用后端数据库对应的存储过程 SQL函数
function(String key0, String key1...)
除了参数会提前赋值,其它和 远程函数 一致 | ["@limit":10,
"@offset":0,
"@procedure()":"getCommentByUserId(id,@limit,@offset)"](http://apijson.cn:8080/get/{"User":{"@limit":10,"@offset":0,"@procedure()":"getCommentByUserId(id,@limit,@offset)"}})
会转为
`getCommentByUserId(38710,10,0)`
来调用存储过程 SQL 函数
`getCommentByUserId(IN id bigint, IN limit int, IN offset int)`
然后变为
"procedure":{
"count":-1,
"update":false,
"list":[]
}
其中 count 是指写操作影响记录行数,-1 表示不是写操作;update 是指是否为写操作(增删改);list 为返回结果集
- 引用赋值 | "key@":"key0/key1/.../refKey",引用路径为用/分隔的字符串。以/开头的是缺省引用路径,从声明key所处容器的父容器路径开始;其它是完整引用路径,从最外层开始。
被引用的refKey必须在声明key的上面。如果对refKey的容器指定了返回字段,则被引用的refKey必须写在@column对应的值内,例如 "@column":"refKey,key1,..." | ["Moment":{
"userId":38710
},
"User":{
"id@":"/Moment/userId"
}](http://apijson.cn:8080/get/{"Moment":{"userId":38710},"User":{"id@":"%252FMoment%252FuserId"}})
User内的id引用了与User同级的Moment内的userId,
即User.id = Moment.userId,请求完成后
"id@":"/Moment/userId" 会变成 "id":38710
- 子查询 | "key@":{
"range":"ALL",
"from":"Table",
"Table":{ ... }
}
其中:
range 可为 ALL,ANY;
from 为目标表 Table 的名称;
@ 后面的对象类似数组对象,可使用 count 和 join 等功能。 | ["id@":{
"from":"Comment",
"Comment":{
"@column":"min(userId)"
}
}](http://apijson.cn:8080/get/{"User":{"id@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}})
WHERE id=(SELECT min(userId) FROM Comment)
- 模糊搜索 | `"key$":"SQL搜索表达式"` => `"key$":["SQL搜索表达式"]`,任意SQL搜索表达式字符串,如 %key%(包含key), key%(以key开始), %k%e%y%(包含字母k,e,y) 等,%表示任意字符 | ["name$":"%m%"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name$":"%2525m%2525"}}}),对应SQL是`name LIKE '%m%'`,查询name包含"m"的一个User数组
- 正则匹配 | "key~":"正则表达式" => "key~":["正则表达式"],任意正则表达式字符串,如 ^[0-9]+$ ,*~ 忽略大小写,可用于高级搜索 | ["name~":"^[0-9]+$"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name~":"^[0-9]%252B$"}}}),对应SQL是`name REGEXP '^[0-9]+$'`,查询name中字符全为数字的一个User数组
- 连续范围 | "key%":"start,end" => "key%":["start,end"],其中 start 和 end 都只能为 Boolean, Number, String 中的一种,如 "2017-01-01,2019-01-01" ,["1,90000", "82001,100000"] ,可用于连续范围内的筛选 | ["date%":"2017-10-01,2018-10-01"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"date%2525":"2017-10-01,2018-10-01"}}}),对应SQL是`date BETWEEN '2017-10-01' AND '2018-10-01'`,查询在2017-10-01和2018-10-01期间注册的用户的一个User数组
- 新建别名 | ① "name:alias",name 映射为 alias,用 alias 替代 name,可用于 column,Table,SQL 函数 等,只用于 GET 类型、HEAD 类型的请求
② 函数调用映射
"@key": "fun:avg(id);keyA:(keyB)",
"fun>": 1,
"keyA": 1
其中 fun:fun(arg) 把 SQL 函数调用 fun(arg) 作为左侧表达式替代 fun,即 fun(arg) > 1;
keyA:(keyB) 表示将字段 keyA 重命名为 keyB,即实际 SQL 中为 keyB = 1,常用于重命名冲突的多条件同名字段。 | ① ["@column":"toId:parentId"](http://apijson.cn:8080/get/{"Comment":{"@column":"id,toId:parentId","id":51}}),对应 SQL 是 `toId AS parentId`,将查询的字段 toId 变为 parentId 返回
② ["@key": "len:length(content);mid:(momentId)",
"len<=": 10,
"mid": 12,
"momentId": 15,
"@combine": "(len<= \\| mid) & momentId"](http://apijson.cn/api?type=JSON&json={%22Comment%22:{%22@key%22:%22len%3Alength(content)%3Bmid%3A(momentId)%22,%22len%3C=%22:10,%22mid%22:12,%22momentId%22:15,%22@combine%22:%22(len%3C%3D%20%7C%20mid)%20%26%20momentId%22}})
对应 SQL 是 `(length(content) <= 10 OR momentId = 12) AND momentId = 15`
- 增加 或 扩展 | "key+":Object,Object的类型由key指定,且类型为Number,String,JSONArray中的一种。如 82001,"apijson",["url0","url1"] 等。只用于PUT请求 | "praiseUserIdList+":[82001],对应SQL是`json_insert(praiseUserIdList,82001)`,添加一个点赞用户id,即这个用户点了赞
- 减少 或 去除 | "key-":Object,与"key+"相反 | "balance-":100.00,对应SQL是`balance = balance - 100.00`,余额减少100.00,即花费了100元
- 比较运算 | >, <, >=, <= 比较运算符,用于
① 提供 "id{}":"<=90000" 这种条件范围的简化写法
② 实现子查询相关比较运算
不支持 "key=":Object 和 "key!=":Object 这两种写法,直接用更简单的 "key":Object 和 "key!":Object 替代。 | ① ["id<=":90000](http://apijson.cn:8080/get/{"[]":{"User":{"id<=":90000}}}),对应 SQL 是`id<=90000`,查询符合id<=90000的一个User数组
② ["id>@":{
"from":"Comment",
"Comment":{
"@column":"min(userId)"
}
}](http://apijson.cn:8080/get/{"User":{"id>@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}})
WHERE id>(SELECT min(userId) FROM Comment)
- 逻辑运算 | &, \|, ! 逻辑运算符,对应数据库 SQL 中的 AND, OR, NOT。
横或纵与:同一键值对的值内条件默认 \| 或连接,可以在 key 后加逻辑运算符来具体指定;不同键值对的条件默认 & 与连接,可以用下面说明的对象关键词 @combine 来具体指定。
① & 可用于 "key&{}":"条件"等
② \| 可用于 "key\|{}":"条件", "key\|{}":[]等,一般可省略
③ ! 可单独使用,如 "key!":Object,也可像 &,\| 一样配合其他功能符使用
"key!":null 无效,null 值会导致整个键值对被忽略解析,可以用 "key{}":"!=null" 替代,
"key":null 同理,用 "key{}":"=null" 替代。 | ① ["id&{}":">80000,<=90000"](http://apijson.cn:8080/head/{"User":{"id&{}":">80000,<=90000"}}),对应SQL是`id>80000 AND id<=90000`,即id满足id>80000 & id<=90000
② ["id\|{}":">90000,<=80000"](http://apijson.cn:8080/head/{"User":{"id\|{}":">90000,<=80000"}}),同 "id{}":">90000,<=80000",对应 SQL 是`id>90000 OR id<=80000`,即 id 满足 id>90000 \| id<=80000
③ ["id!{}":[82001,38710]](http://apijson.cn:8080/head/{"User":{"id!{}":[82001,38710]}}),对应 SQL 是`id NOT IN(82001,38710)`,即 id 满足 ! (id=82001 \| id=38710),可过滤黑名单的消息
- 数组关键词,可自定义 | "key":Object,key为 "[]":{} 中 {} 内的关键词,Object 的类型由 key 指定
① "count":5,查询数量,0 表示最大值,默认值为 10,默认最大值为 100
② "page":1,查询页码,从 0 开始,默认值为 0,默认最大值为 100,一般和 count 一起用
③ "query":2,查询内容
0-对象,1-总数和分页详情,2-数据、总数和分页详情
总数关键词为 total,分页详情关键词为 info,
它们都和 query 同级,通过引用赋值得到自定义 key:value 键值对,不传则返回默认键值对,例如
"total@":"/[]/total", "info@":"/[]/info"
这里query及total仅为GET类型的请求提供方便,
一般可直接用HEAD类型的请求获取总数
④ "compat": true
处理最外层查询字段有特殊处理的情况下 "query":2 返回查询总数不准确的问题:如DISTINCT去重、Aggregate 函数等
⑤ "join":"&/Table0,\"join":{
"&/Table0":{}, // 支持 ON 多个字段关联,
"\ "key0":value0, // 其它ON条件
"key2":value2,
...
"@combine":"...", // 其它ON条件的组合方式
"@column":"...", // 外层 SELECT
"@group":"...", // 外层 GROUP BY
"@having":"..." // 外层 HAVING
}
}
多表连接方式:
"@" - APP JOIN
"\<" - LEFT JOIN
">" - RIGHT JOIN
"&" - INNER JOIN
"\|" - FULL JOIN
"!" - OUTER JOIN
"*" - CROSS JOIN
"^" - SIDE JOIN
"(" - ANTI JOIN
")" - FOREIGN JOIN
其中 @ APP JOIN 为应用层连表,会从已查出的主表里取得所有副表 key@ 关联的主表内的 refKey 作为一个数组 refKeys: [value0, value1...],然后把原来副表 count 次查询 key=$refKey 的 SQL 用 key IN($refKeys) 的方式合并为一条 SQL 来优化性能;
其它 JOIN 都是 SQL JOIN,具体功能和 MySQL,PostgreSQL 等数据库的 JOIN 一一对应
`"join":"`"MainTable":{},`
`"ViceTable":{"key@":"/MainTable/refKey"}`
会对应生成
`MainTable LEFT JOIN ViceTable`
`ON ViceTable.key=MainTable.refKey` AND 其它ON条件
除了 = 等价关联,也支持 ! 不等关联、\> \< \>= \<= 等比较关联和 $ ~ {} <> 等其它复杂关联方式
⑥ "otherKey":Object,自定义关键词,名称和以上系统关键词不一样,且原样返回上传的值 | ① 查询User数组,最多5个:
["count":5](http://apijson.cn:8080/get/{"[]":{"count":5,"User":{}}})
对应 SQL 是`LIMIT 5`
② 查询第3页的User数组,每页5个:
["count":5,
"page":3](http://apijson.cn:8080/get/{"[]":{"count":5,"page":3,"User":{}}})
对应 SQL 是`LIMIT 5 OFFSET 15`
③ 查询User数组和对应的User总数:
["[]":{
"query":2,
"User":{}
},
"total@":"/[]/total", // 可省略
"info@":"/[]/info" // 可省略](http://apijson.cn:8080/get/{"[]":{"query":2,"count":5,"User":{}},"total@":"%252F[]%252Ftotal","info@":"%252F[]%252Finfo"})
返回的数据中,总数及分页详情结构为:
"total":139, // 总数
"info":{ // 分页详情
"total":139, // 总数
"count":5, // 每页数量
"page":0, // 当前页码
"max":27, // 最大页码
"more":true, // 是否还有更多
"first":true, // 是否为首页
"last":false // 是否为尾页
}
④查询User数组ID唯一情况下的User总数:
["[]":{
"query":2,
"compat":"true",
"User":{
"@column":"DISTINCT id"
}
}](http://apijson.cn:8080/get/{"[]":{"query":2,"count":5,"User":{}}})
返回的数据和结构同上
⑤ Moment INNER JOIN User LEFT JOIN Comment:
["[]":{
"join":"&/User/id@,\ "Moment":{
"@group":"id" // 主副表不是一对一,要去除重复数据
},
"User":{
"name~":"t",
"id@":"/Moment/userId"
},
"Comment":{
"momentId@":"/Moment/id"
}
}](http://apijson.cn/api/?type=JSON&url=http://apijson.cn:8080/get&json=%7B%22%5B%5D%22:%7B%22count%22:5,%22join%22:%22%26%2FUser%2Fid@,%3C%2FComment%22,%22Moment%22:%7B%22@column%22:%22id,userId,content%22,%22@group%22:%22id%22%7D,%22User%22:%7B%22name~%22:%22t%22,%22id@%22:%22%2FMoment%2FuserId%22,%22@column%22:%22id,name,head%22%7D,%22Comment%22:%7B%22momentId@%22:%22%2FMoment%2Fid%22,%22@column%22:%22id,momentId,content%22%7D%7D%7D)
⑥ 每一层都加当前用户名:
["User":{},
"[]":{
"name@":"User/name", // 自定义关键词
"Moment":{}
}](http://apijson.cn:8080/get/{"User":{},"[]":{"name@":"User%252Fname","Moment":{}}})
- 对象关键词,可自定义 | "@key":Object,@key 为 Table:{} 中 {} 内的关键词,Object 的类型由 @key 指定
① "@combine":"key0 \| (key1 & (key2 \| !key3))...",条件组合方式,最终按
(其它key条件 AND 连接) AND (key0条件 OR (key1条件 AND (key2条件 OR (NOT key3条件))))
这种方式连接,其中 "其它key" 是指与 @combine 在同一对象,且未被它声明的条件 key,默认都是 & 连接。注意不要缺少或多余任何一个空格。
② "@column":"column;function(arg)...",返回字段
③ "@order":"column0+,column1-...",排序方式
④ "@group":"column0,column1...",分组方式。如果 @column 里声明了 Table 的 id,则 id 也必须在 @group 中声明;其它情况下必须满足至少一个条件:
1.分组的 key 在 @column 里声明
2.Table 主键在 @group 中声明
⑤ "@having":"function0(...)?value0;function1(...)?value1;function2(...)?value2..." // OR 连接,或
"@having&":"function0(...)?value0;function1(...)?value1;function2(...)?value2..." // AND 连接,或
"@having":{
"h0":"function0(...)?value0",
"h1":function1(...)?value1",
"h2":function2(...)?value2...",
"@combine":"h0 & (h1 \| !h2)" // 任意组合,非必传
}
SQL 函数条件,一般和 @group 一起用,函数一般在 @column 里声明
⑥ "@schema":"sys",集合空间(数据库名/模式),非默认的值可通过它来指定,可以在最外层作为全局默认配置
⑦ "@database":"POSTGRESQL",数据库类型,非默认的值可通过它来指定,可以在最外层作为全局默认配置
⑧ "@datasource":"DRUID",跨数据源,非默认的值可通过它来指定,可以在最外层作为全局默认配置
⑨ "@json":"key0,key1...",转为 JSON 格式返回,符合 JSONObject 则转为 {...},符合 JSONArray 则转为 \[...]
⑩ "@role":"OWNER",来访角色,包括
UNKNOWN,LOGIN,CONTACT,CIRCLE,OWNER,ADMIN,
可以在最外层作为全局默认配置,
可自定义其它角色并重写 Verifier.verify 等相关方法来自定义校验
⑪ "@explain":true,性能分析,可以在最外层作为全局默认配置
⑫ "@raw":"key0,key1...",其中 key0, key1 都对应有键值对
"key0":"SQL片段或SQL片段的别名",
"key1":"SQL片段或SQL片段的别名"
自定义原始SQL片段,可扩展嵌套SQL函数等复杂语句,必须是后端已配置的,只有其它功能符都做不到才考虑,谨慎使用,注意防 SQL 注入
⑬ "@null":"key1,key2...",空值键值对,自动插入 key1:null, key2:null ... 并作为有效键值对执行,作为条件时对应 SQL 是 `WHERE tag IS NULL`,作为值时对应 SQL 是 `SET tag = NULL`
⑭ "@otherKey":Object,自定义关键词,名称和以上系统关键词不一样,且原样返回上传的值 | ① 搜索 name 或 tag 任何一个字段包含字符 a 的 User 列表:
["name~":"a",
"tag~":"a",
"@combine":"name~ \| tag~"](http://apijson.cn:8080/get/{"User[]":{"count":10,"User":{"@column":"id,name,tag","name~":"a","tag~":"a","@combine":"name~%20%7C%20tag~"}}})
对应SQL是`name REGEXP 'a' OR tag REGEXP 'a'`
② 只查询 id,sex,name 这几列并且请求结果也按照这个顺序:
["@column":"id,sex,name"](http://apijson.cn:8080/get/{"User":{"@column":"id,sex,name","id":38710}})
对应 SQL 是`SELECT id,sex,name`
③ 查询按 name 降序、id 默认顺序 排序的 User 数组:
["@order":"name-,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"User":{"@column":"name,id","@order":"name-,id"}}})
对应 SQL 是`ORDER BY name DESC,id`
④ 查询按 userId 分组的 Moment 数组:
["@group":"userId,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})
对应 SQL 是`GROUP BY userId,id`
⑤ 查询 按 userId 分组、id 最大值>=100 的 Moment 数组:
["@column":"userId;max(id)",
"@group":"userId",
"@having":"max(id)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id)","@group":"userId","@having":"max(id)>=100"}}})
对应 SQL 是`SELECT userId,max(id) ... GROUP BY userId HAVING max(id)>=100`
还可以指定函数返回名:
["@column":"userId;max(id):maxId",
"@group":"userId",
"@having":"(maxId)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id):maxId","@group":"userId","@having":"(maxId)>=100"}}})
对应 SQL 是`SELECT userId,max(id) AS maxId ... GROUP BY userId HAVING (maxId)>=100`
⑥ 查询 sys 内的 User 表:
["@schema":"sys"](http://apijson.cn:8080/get/{"User":{"@schema":"sys"}})
对应 SQL 是`FROM sys.User`
⑦ 查询 PostgreSQL 数据库的 User 表:
["@database":"POSTGRESQL"](http://apijson.cn:8080/get/{"User":{"@database":"POSTGRESQL","@explain":true}})
⑧ 使用 Druid 连接池查询 User 表:
["@datasource":"DRUID"](http://apijson.cn:8080/get/{"User":{"@datasource":"DRUID"}})
⑨ 将 VARCHAR 字符串字段 get 转为 JSONArray 返回:
["@json":"get"](http://apijson.cn:8080/get/{"Access":{"@json":"get"}})
⑩ 查询当前用户的动态:
["@role":"OWNER"](http://apijson.cn:8080/get/{"[]":{"Moment":{"@role":"OWNER"}}})
⑪ 开启性能分析:
["@explain":true](http://apijson.cn:8080/get/{"[]":{"Moment":{"@explain":true}}})
对应 SQL 是`EXPLAIN`
⑫ 统计最近一周偶数 userId 的数量
["@column":"date;left(date,10):day;sum(if(userId%2=0,1,0))",
"@group":"day",
"@having":"to_days(now())-to_days(\`date\`)<=7",
"@raw":"@column,@having"](http://apijson.cn:8080/get/{"[]":{"Moment":{"@column":"date%3bleft(date,10):day%3bsum(if(userId%252=0,1,0))","@group":"day","@having":"to_days(now())-to_days(\`date\`)<=7","@raw":"@column,@having"}}})
对应 SQL 是``SELECT date, left(date,10) AS day, sum(if(userId%2=0,1,0)) ... GROUP BY day HAVING to_days(now())-to_days(`date`)<=7``
⑬ 把用户的标签设置为空
["@null":"tag"](http://apijson.cn/api/?type=JSON&url=http://apijson.cn:8080/put/User&json={%22id%22:82001,%22@null%22:%22tag%22,%22@explain%22:true})
⑭ 从pictureList 获取第 0 张图片:
["@position":0, // 自定义关键词
"firstPicture()":"getFromArray(pictureList,@position)"](http://apijson.cn:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"getFromArray(pictureList,@position)"}})
- 全局关键词 | 为最外层对象 {} 内的关键词。其中 @database,@schema, @datasource, @role, @explain 基本同对象关键词,见上方说明,区别是全局关键词会每个表对象中没有时自动放入,作为默认值。
① "tag":"Table",后面的 tag 是非 GET、HEAD 请求中匹配请求的 JSON 结构的标识,一般是要查询的 Table 的名称或该名称对应的数组 Table[] 或 Table:[],由后端 Request 表中指定。
② "version":1,接口版本,version 不传、为 null 或 <=0 都会使用最高版本,传了其它有效值则会使用最接近它的最低版本,由后端 Request 表中指定。
③ "format":true,格式化返回 Response JSON 的 key,一般是将 TableName 转为 tableName, TableName[] 转为 tableNameList, Table:alias 转为 alias, TableName-key[] 转为 tableNameKeyList 等小驼峰格式。 | ① 查隐私信息:
[{"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
② 使用第 1 版接口查隐私信息:
[{"version":1,"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22version%22:1,%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
③ 格式化朋友圈接口返回 JSON 中的 key:
[{
"format":true,
"[]":{
"page":0,
"count":3,
"Moment":{},
"User":{
"id@":"/Moment/userId"
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"format":true,"[]":{"page":0,"count":3,"Moment":{},"User":{"id@":"%252FMoment%252FuserId"},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
+ Get data in arrays | `"key[]":{}`
The part after the colon is a JSONObject. *key* is optional. When *key* is the same as the table name , the JSONObject will be in a simplified form. For example, `{Table:{Content}}` will be written as `{Content}`.| [{"User[]":{"User":{}}}](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{}}})
It is used for getting data from a user. Here, key and tablename are all "User", then
`{"User":{"id", ...}}`
will be written as
`{"id", ...}`
+ Get data that meets specific conditions | `"key{}":[]`
The part after the colon is a JSONArray with conditions inside.| ["id{}":[38710,82001,70793]](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":[38710,82001,70793]}}})
In SQL, this would be `id IN(38710,82001,70793)`.
It means getting data with id equals 38710,82001,70793.
+ Get data with comparison operation| `"key{}":"condition0,condition1..."`
Conditions can be any SQL comparision operation. Use''to include any non-number characters.| ["id{}":"<=80000,\>90000"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"id{}":"<=80000,\>90000"}}})
In SQL, it'd be
`id<=80000 OR id>90000`,
which means get User array with id\<=80000 \| id>90000
+ Get data that contains an element | `"key<>":Object` => `"key<>":[Object]`
*key* must be a JSONArray while *Object* cannot be JSON.| ["contactIdList<\>":38710](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"contactIdList<\>":38710}}})
In SQL, this would be
`json_contains(contactIdList,38710)`.
It means find data of the User whose contactList contains 38710.
+ See if it exists |`"key}{@":{`
`"from":"Table",`
`"Table":{ ... }`
`}`
}{ means EXISTS.
*key* is the one you want to check.
Here is a *Subquery* in it, see specifications below for more information. | ["id}{@":{
"from":"Comment",
"Comment":{
"momentId":15
}
}](http://apijson.cn:8080/get/{"User":{"id}{@":{"from":"Comment","Comment":{"momentId":15}}}})
WHERE EXISTS(SELECT * FROM Comment WHERE momentId=15)
+ Include functions in parameters | `"key()":"function (key0,key1...)"`
This will trigger the back-end
`function(JSONObject request, String key0, String key1...)`
to get or testify data.
Use - and + to show the order of priority: analyze key-() > analyze the current object > analyze key() > analyze child object > analyze key+()| ["isPraised()":"isContain(praiseUserIdList,userId)"](http://apijson.cn:8080/get/{"Moment":{"id":301,"isPraised()":"isContain(praiseUserIdList,userId)"}})
This will use function boolean isContain(JSONObject request, String array, String value). In this case, client will get "isPraised":true(In this case, client use function to testify if a user clicked ‘like’ button for a Moment.)
+ Refer a value | `"key@":"key0/key1/.../refKey"`
Use / to show path. The part before the colon is the key that wants to refer. The path after the colon starts with the parent level of the key.| ["Moment":{
"userId":38710
},
"User":{
"id@":"/Moment/userId"
}](http://apijson.cn:8080/get/{"Moment":{"userId":38710},"User":{"id@":"%252FMoment%252FuserId"}})
In this example, the value of id in User refer to the *userId* in *Moment*, which means
`User.id = Moment.userId`.
After the request is sent,
`"id@":"/Moment/userId"` will be `"id":38710`.
+ Subquery | `"key@":{`
`"range":"ALL",`
`"from":"Table",`
`"Table":{ ... }`
`}`
*range* can be ALL, ANY.
*from* means which table you want to query.
It’s very similar to how you query in SQL.
You can also use *count*, *join*, etc. | ["id@":{
"from":"Comment",
"Comment":{
"@column":"min(userId)"
}
}](http://apijson.cn:8080/get/{"User":{"id@":{"from":"Comment","Comment":{"@column":"min(userId)"}}}})
`WHERE id=(SELECT min(userId) FROM Comment)`.
+ Fuzzy matching | `"key$":"SQL search expressions"` => `"key$":["SQL search expressions"]`
Any SQL search expressions.Eg.%key%(include key), key%(start with key),%k%e%y%(include k, e, y). % means any characters. | ["name$":"%m%"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name$":"%2525m%2525"}}})
In SQL, it's
`name LIKE '%m%'`,
meaning that get User with ‘m’ in name.
+ Regular Expression| `"key~":"regular expression"` => `"key~":["regular expression"]`
It can be any regular expressions.Eg. ^[0-9]+$ ,*~ not case sensitive, advanced search is applicable.| ["name~":"^[0-9]+$"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"name~":"^[0-9]%252B$"}}})
In SQL, it's
`name REGEXP '^[0-9]+$'`.
+ Get data in a range| `"key%":"start,end"` => `"key%":["start,end"]`
The data type of start and end can only be either Boolean, Number or String. Eg. "2017-01-01,2019-01-01" ,["1,90000", "82001,100000"]. It's used for getting data from a specific time range. | ["date%":"2017-10-01,2018-10-01"](http://apijson.cn:8080/get/{"User[]":{"count":3,"User":{"date%2525":"2017-10-01,2018-10-01"}}})
In SQL, it's
`date BETWEEN '2017-10-01' AND '2018-10-01'`,
meaning to get User data that registered between 2017-10-01 and 2018-10-01.
+ Make an alias | `"name:alias"`
this changes name to alias in returning results. It’s applicable to column, tableName, SQL Functions, etc. but only in GET, HEAD requests. | ["@column":"toId:parentId"](http://apijson.cn:8080/get/{"Comment":{"@column":"id,toId:parentId","id":51}})
In SQL, it's
`toId AS parentId`.
It'll return `parentId` instead of `toId`.
For @key format like "lc_wai6b3vk2:(lc_wai6b3vk)", it means renaming field lc_wai6b3vk2 to lc_wai6b3vk, commonly used for field renaming scenarios. Example:
{
"lc_sinan_ba074fbb": {
"lc_wai6b3vk": "11",
"lc_wai6b3vk2": "22",
"@combine": "lc_wai6b3vk \\| lc_wai6b3vk2",
"@key": "lc_wai6b3vk2:(lc_wai6b3vk)"
}
}
corresponds to SQL `(lc_wai6b3vk = '11' OR lc_wai6b3vk2 = '22')`, but the lc_wai6b3vk2 field will be renamed and displayed as lc_wai6b3vk in the returned result
+ Add / expand an item | `"key+":Object`
The type of Object is decided by *key*. Types can be Number, String, JSONArray. Froms are 82001,"apijson",["url0","url1"] respectively. It’s only applicable to PUT request.| "praiseUserIdList+":[82001]. In SQL, it's
`json_insert(praiseUserIdList,82001)`.
Add an *id* that praised the Moment.
+ Delete / decrease an item | `"Key-":Object`
It’s the contrary of "key+" | "balance-":100.00. In SQL, it's
`balance = balance - 100.00`,
meaning there's 100 less in balance.
+ Operations | &, \|, !
They're used in logic operations. It’s the same as AND, OR, NOT in SQL respectively.
By default, for the same key, it’s ‘\|’ (OR)operation among conditions; for different keys, the default operation among conditions is ‘&’(AND).
| ① ["id&{}":">80000,<=90000"](http://apijson.cn:8080/head/{"User":{"id&{}":">80000,<=90000"}})
In SQL, it's
`id>80000 AND id<=90000`,
meaning *id* needs to be id>80000 & id<=90000
② ["id\|{}":">90000,<=80000"](http://apijson.cn:8080/head/{"User":{"id\|{}":">90000,<=80000"}})
It's the same as "id{}":">90000,<=80000".
In SQL, it's
`id>80000 OR id<=90000`,
meaning that *id* needs to be id>90000 \| id<=80000
③ ["id!{}":[82001,38710]](http://apijson.cn:8080/head/{"User":{"id!{}":[82001,38710]}})
In SQL, it's
`id NOT IN(82001,38710)`,
meaning id needs to be ! (id=82001 \| id=38710).
+ Keywords in an Array: It can be self-defined. | As for `"key":Object`, *key* is the keyword of *{}* in *"[]":{}*. The type of *Object* is up to *key*.
① `"count":Integer` It's used to count the number. The default largest number is 100.
② `"page":Integer` It’s used for getting data from which page, starting from 0. The default largest number is 100. It’s usually used with COUNT.
③ `"query":Integer` Get the number of items that match conditions
When to get the object, the integer should be 0; when to get the total number, it’s 1; when both above, it’s 2.
You can get the total number with keyword total. It can be referred to other values.
Eg.
`"total@":"/[]/total"`
Put it as the same level of query.
*Query* and *total* are used in GET requests just for convenience. Generally, HEAD request is for getting numbers like the total number.
④ `"join":"&/Table0,Join tables:
"\<" - LEFT JOIN
">" - RIGHT JOIN
"&" - INNER JOIN
"\|" - FULL JOIN
"!" - OUTER JOIN
"@" - APP JOIN
Where @ APP JOIN is in application layer.It’ll get all the keys in tables that refKeys in result tables are referred to, like refKeys:[value0, value1….]. Then, as the results get data according to `key=$refKey` a number of times (COUNT), it uses key `IN($refKeys)` to put these counts together in just one SQL query, in order to improve the performance.
Other JOIN functions are the same as those in SQL.
`"join":"`"MainTable":{},`
`"ViceTable":{"key@":"/MainTable/refKey"}`
will return
`MainTable LEFT JOIN ViceTable`
`ON ViceTable.key=MainTable.refKey`
⑤ `"otherKey":Object` Self-defined keyword other than those that already in the system. It also returns with self-defined keywords.| ① Get User arrays with maximum of 5:
["count":5](http://apijson.cn:8080/get/{"[]":{"count":5,"User":{}}})
② Look into User arrays on page 3. Show 5 of them each page.
["count":5,
"page":3](http://apijson.cn:8080/get/{"[]":{"count":5,"page":3,"User":{}}})
③ Get User Arrays and count the total number of Users:
["[]":{
"query":2,
"User":{}
},
"total@":"/[]/total"](http://apijson.cn:8080/get/{"[]":{"query":2,"count":5,"User":{}},"total@":"%252F[]%252Ftotal"})
Questions like total page numbers or if there's next page can be solved by total,count,page functions,
Total page number:
`int totalPage = Math.ceil(total / count)`
If this is the last page:
`boolean hasNextPage = total > count*page`
If this is the first page:
`boolean isFirstPage = page <= 0`
If it's the last page:
`boolean isLastPage = total <= count*page`
...
④ Moment INNER JOIN User LEFT JOIN Comment:
["[]":{
"join": "&/User,\ "Moment":{},
"User":{
"name~":"t",
"id@": "/Moment/userId"
},
"Comment":{
"momentId@": "/Moment/id"
}
}](http://apijson.cn:8080/get/{"[]":{"count":5,"join":"&%252FUser,\<%252FComment","Moment":{"@column":"id,userId,content"},"User":{"name~":"t","id@":"%252FMoment%252FuserId","@column":"id,name,head"},"Comment":{"momentId@":"%252FMoment%252Fid","@column":"id,momentId,content"}}})
⑤ Add the current user to every level:
["User":{},
"[]":{
"name@":"User/name", //self-defined keyword
"Moment":{}
}](http://apijson.cn:8080/get/{"User":{},"[]":{"name@":"User%252Fname","Moment":{}}})
+ Keywords in Objects: It can be self-defined. | `"@key":Object` @key is the keyword of {} in Table:{}. The type of Object is decided by @key
① `"@combine":"&key0,&key1,\|key2,key3,`
`!key4,!key5,&key6,key7..."`
First, it’ll group data with same operators. Within one group, it operates from left to right. Then it’ll follow the order of & \| ! to do the operation. Different groups are connected with &. So the expression above will be :
(key0 & key1 & key6 & other key) & (key2 \| key3 \| key7) & !(key4 \| key5)
\| is optional.
② `"@column":"column;function(arg)..."` Return with specific columns.
③ `"@order":"column0+,column1-..."` Decide the order of returning results:
④ `"@group":"column0,column1..."` How to group data. If @column has declared Table id, this id need to be included in @group. In other situations, at least one of the following needs to be done:
1.Group id is declared in @column
2.Primary Key of the table is declared in @group.
⑤ `@having":"function0(...)?value0;function1(...)?value1;function2(...)?value2..."` Add conditions on return results with @having. Usually working with@group, it’s declared in @column.
⑥ `"@schema":"sys"` Can be set as default setting.
⑦ `"@database":"POSTGRESQL"` Get data from a different database.Can be set as default setting.
⑧ `"@role":"OWNER"` Get information of the user, including
UNKNOWN,LOGIN,CONTACT,CIRCLE,OWNER,ADMIN,
Can be set as default setting.
You can self-define a new role or rewrite a role. Use`Verifier.verify` etc. to self-define validation methods.
⑨ `"@explain":true` Profiling. Can be set as default setting.
⑩ `"@otherKey":Object` Self-define keyword | ① Search *Users* that *name* or *tag* contains the letter "a":
["name~":"a",
"tag~":"a",
"@combine":"name~,tag~"](http://apijson.cn:8080/get/{"User[]":{"count":10,"User":{"@column":"id,name,tag","name~":"a","tag~":"a","@combine":"name~,tag~"}}})
② Only search column id,sex,name and return with the same order:
["@column":"id,sex,name"](http://apijson.cn:8080/get/{"User":{"@column":"id,sex,name","id":38710}})
③ Search Users that have descending order of name and default order of id:
["@order":"name-,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"User":{"@column":"name,id","@order":"name-,id"}}})
④ Search Moment grouped with userId:
["@group":"userId,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})
⑤ Search Moments that id equals or less than 100 and group with userId:
["@column":"userId;max(id)",
"@group":"userId",
"@having":"max(id)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id)","@group":"userId","@having":"max(id)>=100"}}})
You can also define the name of the returned function:
["@column":"userId;max(id):maxId",
"@group":"userId",
"@having":"(maxId)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId%253Bmax(id):maxId","@group":"userId","@having":"(maxId)>=100"}}})
⑥ Check Users table in sys:
["@schema":"sys"](http://apijson.cn:8080/get/{"User":{"@schema":"sys"}})
⑦ Check Users table in PostgreSQL:
["@database":"POSTGRESQL"](http://apijson.cn:8080/get/{"User":{"@database":"POSTGRESQL"}})
⑧ Check the current user's activity:
["@role":"OWNER"](http://apijson.cn:8080/get/{"[]":{"Moment":{"@role":"OWNER"}}})
⑨ Turn on profiling:
["@explain":true](http://apijson.cn:8080/get/{"[]":{"Moment":{"@explain":true}}})
⑩ Get the No.0 picture from pictureList:
["@position":0, //self-defined keyword
"firstPicture()":"getFromArray(pictureList,@position)"](http://apijson.cn:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"getFromArray(pictureList,@position)"}})
+ global keyword. | It is a keyword inside the outermost object {}. Among them, @database, @schema, @datasource, @role, and @explain are basically the same as object keywords, see the above description, the difference is that the global keywords will be automatically inserted in each table object as the default value.
① "tag": String, the following tag is the identifier of the JSON structure matching the request in non-GET or HEAD requests, generally it is the name of the Table to be queried or the array Table[] or Table:[] corresponding to the name, determined by the backend specified in the Request table.
② "version": Integer, the interface version. If the version is not passed, null or <=0, the highest version will be used. If other valid values are passed, the lowest version closest to it will be used, which is specified in the backend Request table.
③ "format": Boolean, formatted to return the key of the Response JSON, generally converting TableName to tableName, TableName[] to tableNameList, Table:alias to alias, TableName-key[] to tableNameKeyList and other camelcase formats. | ① Check private information::
[{"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
② Use the version 1 interface to check private information::
[{"version":1,"tag":"Privacy","Privacy":{"id":82001}}](http://apijson.cn/api?url=http%3A%2F%2Fapijson.cn%3A8080%2Fgets&type=JSON&json={%22version%22:1,%22tag%22:%22Privacy%22,%22Privacy%22:{%22id%22:82001}})
③ Format Moments interface to return in JSON key:
[{
"format":true,
"[]":{
"page":0,
"count":3,
"Moment":{},
"User":{
"id@":"/Moment/userId"
},
"Comment[]":{
"count":3,
"Comment":{
"momentId@":"[]/Moment/id"
}
}
}
}](http://apijson.cn:8080/get/{"format":true,"[]":{"page":0,"count":3,"Moment":{},"User":{"id@":"%252FMoment%252FuserId"},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
+
+
From fc9dc10c5e985ae480bf01d036b16f6a43c6abd4 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 16:26:30 +0800
Subject: [PATCH 44/64] add shortcuts for supported databases, languages,
frameworks in README.md
---
README.md | 40 +++++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index ccafb985..239f4dc9 100644
--- a/README.md
+++ b/README.md
@@ -9,35 +9,42 @@ This source code is licensed under the Apache License Version 2.0
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -47,12 +54,15 @@ This source code is licensed under the Apache License Version 2.0
+
From ef11ad8925e89e41fe0687fd1efcfb530b857413 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 16:28:01 +0800
Subject: [PATCH 45/64] Update README-Chinese.md
---
README-Chinese.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README-Chinese.md b/README-Chinese.md
index 72e15ba6..7f1a214c 100644
--- a/README-Chinese.md
+++ b/README-Chinese.md
@@ -9,8 +9,8 @@ This source code is licensed under the Apache License Version 2.0
后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构
-
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
From 50b60483648d9bc4890b39f610a8e20e39eff7ed Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 16:30:44 +0800
Subject: [PATCH 47/64] Update README-Chinese.md
---
README-Chinese.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README-Chinese.md b/README-Chinese.md
index 7f1a214c..95ad64c2 100644
--- a/README-Chinese.md
+++ b/README-Chinese.md
@@ -9,7 +9,7 @@ This source code is licensed under the Apache License Version 2.0
后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
From 59491fe28b4f0ab3f64962a43f08045a5dace96e Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 16:34:15 +0800
Subject: [PATCH 49/64] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 9cbc1ab7..3953e029 100644
--- a/README.md
+++ b/README.md
@@ -10,8 +10,8 @@ This source code is licensed under the Apache License Version 2.0
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
-
A JSON Transmission Protocol and an ORM Library for providing APIs and Documents without writing any code.
providing APIs and Docs without coding by Backend, and the response JSON can be customized by Frontend(Client) users
---
-#### A better online document is available at https://apijsondocs.readthedocs.io/
-
* ### [1.About](#1)
* ### [2.Backend usage](#2)
* ### [3.Frontend usage](#3)
@@ -228,8 +226,8 @@ See the latest release [here](https://github.com/Tencent/APIJSON/releases/tag/5.
## 6. Author
-Check out the author's [github account](https://github.com/TommyLemon) to see more related projects.
-
+https://github.com/TommyLemon
+
If you have any questions or suggestions, you can [create an issue](https://github.com/Tencent/APIJSON/issues) or [send me an e-mail](mailto:tommylemon@qq.com).
From 30b5a6868a3e7d5cfc0210cddbb397ed92e491a5 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 17:25:16 +0800
Subject: [PATCH 52/64] Update Document.md
---
Document.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Document.md b/Document.md
index 253fb6cb..7574e569 100644
--- a/Document.md
+++ b/Document.md
@@ -1,3 +1,5 @@
+#### A better online document is available at https://apijsondocs.readthedocs.io
+
### Examples:
#### Get a User
From 45582e71dc61b59752a61aef9496e992945dc359 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 17:26:30 +0800
Subject: [PATCH 53/64] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1104465d..822dc0f8 100644
--- a/README.md
+++ b/README.md
@@ -220,7 +220,7 @@ Please also ⭐Star the project!
##
5. Releases
-See the latest release [here](https://github.com/Tencent/APIJSON/releases/tag/5.2.0).
+See the latest release [here](https://github.com/Tencent/APIJSON/releases)
From fc255264c8acdf28a37e1645c1930d54eecc5a61 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 15 Feb 2026 17:30:15 +0800
Subject: [PATCH 54/64] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 822dc0f8..84bf92cc 100644
--- a/README.md
+++ b/README.md
@@ -89,7 +89,7 @@ This source code is licensed under the Apache License Version 2.0
* ### [3.Frontend usage](#3)
* ### [4.Contributing](#4)
* ### [5.Releases](#5)
-* ### [6.Author](#6)
+* ### [6.Creator](#6)
* ### [7.Donating](#7)
@@ -224,7 +224,7 @@ See the latest release [here](https://github.com/Tencent/APIJSON/releases)
-## 6. Author
+##
6. Creator
https://github.com/TommyLemon
From 92cbf66b6da68a10664e87711485632b052f2d7b Mon Sep 17 00:00:00 2001
From: hobostay <110hqc@gmail.com>
Date: Tue, 17 Feb 2026 19:39:10 +0800
Subject: [PATCH 55/64] fix(logging): Replace printStackTrace() with proper
logging
Replace all e.printStackTrace() calls with Log.e() to follow best
practices for error handling and logging. This provides:
- Consistent logging format with timestamps
- Better error tracking in production
- Ability to control logging via Log.DEBUG flag
- More meaningful error messages with context
Changes:
- AbstractSQLExecutor.java: 9 replacements
- AbstractParser.java: 6 replacements
- JSONRequest.java: 1 replacement
- JSR223ScriptExecutor.java: 1 replacement
Co-Authored-By: Claude Sonnet 4.5
> ovs = config.getValues();
if ( (c == null || c.isEmpty()) || (ovs == null || ovs.isEmpty()) ) {
@@ -533,17 +522,17 @@ public void verifyRepeat(String table, String key, Object value, long exceptId)
throw new UnsupportedDataTypeException(key + ":value 中value的类型不能为JSON!");
}
- M tblObj = JSON.createJSONObject();
+ M tblObj = createJSONObject();
tblObj.put(key, value);
if (exceptId > 0) {//允许修改自己的属性为该属性原来的值
- tblObj.put(JSONMap.KEY_ID + "!", exceptId); // FIXME 这里 id 写死了,不支持自定义
+ tblObj.put(KEY_ID + "!", exceptId); // FIXME 这里 id 写死了,不支持自定义
}
- M req = JSON.createJSONObject();
+ M req = createJSONObject();
req.put(table, tblObj);
Map
-
providing APIs and Docs without coding by Backend, and the response JSON can be customized by Frontend(Client) users
providing APIs and Docs without coding by Backend, and Frontend can customize response JSONs
-
providing APIs and Docs without coding by Backend, and Frontend can customize response JSONs
providing APIs and Docs without coding by Backend, and Frontend can customize response JSONs
-Authors of other projects for ecosystem of APIJSON(2 Tencent engineers, 1 BAT(Baidu/Alibaba/Tencent) specialist, 1 Microsoft engineer, 2 Bytedance(TikTok) engineers, 1 Digital China engineer & Apache dubbo2js author, etc.):
+Authors of other projects for ecosystem of APIJSON(2 Tencent engineers, 1 BAT(Baidu/Alibaba/Tencent) expert, 1 Microsoft engineer, 2 Bytedance(TikTok) engineers, 1 Digital China engineer & Apache dubbo2js author, etc.):
https://github.com/search?o=desc&q=apijson&s=stars&type=Repositories
https://search.gitee.com/?skin=rec&type=repository&q=apijson&sort=stars_count