compiledScriptMap = new ConcurrentHashMap<>();
@@ -45,7 +48,7 @@ public void load(String name, String script) {
CompiledScript compiledScript = ((Compilable) scriptEngine).compile(convertScript(script));
compiledScriptMap.put(name, compiledScript);
} catch (Exception e) {
- e.printStackTrace();
+ Log.e(TAG, "compile script failed: " + name, e);
}
}
diff --git a/APIJSONORM/src/main/java/apijson/package-info.java b/APIJSONORM/src/main/java/apijson/package-info.java
index 42e240185..a4fcbeb21 100755
--- a/APIJSONORM/src/main/java/apijson/package-info.java
+++ b/APIJSONORM/src/main/java/apijson/package-info.java
@@ -1,4 +1,4 @@
-/*Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
+/*Copyright (C) 2020 Tencent. All rights reserved.
This source code is licensed under the Apache License Version 2.0.*/
diff --git a/APIJSONORM/src/main/resources/application.properties b/APIJSONORM/src/main/resources/application.properties
deleted file mode 100755
index e69de29bb..000000000
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f9656e289..f9fab2942 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,7 +25,7 @@
- [403f](https://github.com/403f)
- [gujiachun](https://github.com/gujiachun)
- [gdjs2](https://github.com/gdjs2)(University of California, Riverside)
-- [Rkyzzy](https://github.com/Rkyzzy)(SUSTech, University of California, Berkeley)
+- [Rkyzzy](https://github.com/Rkyzzy)(理想汽车工程师, SUSTech, University of California, Berkeley)
- [kxlv2000](https://github.com/kxlv2000)(SUSTech)
- [caohao-go](https://github.com/caohao-go)(腾讯工程师,曾在华为、恒生担任C/C++开发工程师,在wps担任项目经理,在360担任技术专家)
- [Wscats](https://github.com/Wscats)(腾讯工程师、腾讯 AlloyTeam 成员、Tencent Creation Camp 成员、知名技术博主)
@@ -33,10 +33,10 @@
- [JieJo](https://github.com/JieJo)
- [yeyuezhishou](https://github.com/yeyuezhishou)(圆通工程师)
- [kenlig](https://github.com/kenlig)(还开源了 apijsondocs)
-- [andream7](https://github.com/andream7)(微软工程师,还开源了 apijson-db2)
+- [andream7](https://github.com/andream7)(字节跳动、微软 工程师,还开源了 apijson-db2)
- [qiujunlin](https://github.com/qiujunlin)(字节跳动工程师,还开源了 APIJSONDemo)
- [HANXU2018](https://github.com/HANXU2018)(网易工程师,还开源了 APIJSON-DOC)
-- [hclown9804](https://github.com/hclown9804)
+- [hclown9804](https://github.com/hclown9804)(Datawhale)
- [chenyanlann](https://github.com/chenyanlann)(还开源了 APIJSONDemo_ClickHouse)
- [haolingzhang1](https://github.com/haolingzhang1)(腾讯工程师,还开源了 APIJson--demo)
- [jerrylususu](https://github.com/jerrylususu)(还开源了 apijson_todo_demo 和 apijson_role_extend)
@@ -57,7 +57,7 @@
- [aninZz](https://github.com/aninZz)
- [leomiaomiao](https://github.com/leomiaomiao)
- [YqxLzx](https://github.com/YqxLzx)
-- [hiteshbedre](https://github.com/hiteshbedre)
+- [hiteshbedre](https://github.com/hiteshbedre)(privado.ai 印裔工程师)
- [wahowaho](https://github.com/wahowaho)
- [jarrodquan](https://github.com/jarrodquan)
- [gemufeng](https://github.com/gemufeng)(上海麦市工程师)
@@ -71,6 +71,10 @@
- [calmcc](https://github.com/calmcc)
- [lindaifeng](https://github.com/lindaifeng)
- [DenineLu](https://github.com/DenineLu)(小红书工程师)
+- [wz11wz](https://github.com/wz11wz)
+- [GeXin97](https://github.com/GeXin97)
+- [yunjiao-source](https://github.com/yunjiao-source)(还开源了 [apijson-spring-boot](https://gitee.com/yunjiao-source/apijson-spring-boot))
+- [moxixi527](https://github.com/moxixi527)(热门技术博主)
#### 其中特别致谢:
cloudAndMonkey 提交的 11 个 Commits, 对 APIJSON 做出了 1,496 增加和 845 处删减(截止 2022/12/15 日);
diff --git a/Document-Chinese.md b/Document-Chinese.md
new file mode 100644
index 000000000..ffe8e975e
--- /dev/null
+++ b/Document-Chinese.md
@@ -0,0 +1,425 @@
+## 中文 | [English](https://github.com/Tencent/APIJSON/blob/master/Document.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)
+
+
+## 1.示例
+
+#### 获取用户
+请求:
+{
+ "User":{
+ "id":38710
+ }
+}
+
+
+[点击这里测试](http://apijson.cn:8080/get/{"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"
+}
+
+
+
+ [GIF] APIJSON 各种单表对象查询:简单查询、统计、分组、排序、聚合、比较、筛选字段、字段别名 等
+
+
+
+
+
+
+#### 获取用户列表
+请求:
+{
+ "[]":{
+ "count":3, //只要3个
+ "User":{
+ "@column":"id,name" //只要id,name这两个字段
+ }
+ }
+}
+
+
+[点击这里测试](http://apijson.cn:8080/get/{"[]":{"count":3,"User":{"@column":"id,name"}}})
+
+返回:
+{
+ "[]":[
+ {
+ "User":{
+ "id":38710,
+ "name":"TommyLemon"
+ }
+ },
+ {
+ "User":{
+ "id":70793,
+ "name":"Strong"
+ }
+ },
+ {
+ "User":{
+ "id":82001,
+ "name":"Android"
+ }
+ }
+ ],
+ "code":200,
+ "msg":"success"
+}
+
+
+
+ [GIF] APIJSON 各种单表数组查询:简单查询、统计、分组、排序、聚合、分页、比较、搜索、正则、条件组合 等
+
+
+
+
+
+
+#### 获取动态及发布者用户
+请求:
+{
+ "Moment":{
+ },
+ "User":{
+ "id@":"Moment/userId" //User.id = Moment.userId
+ }
+}
+
+
+[点击这里测试](http://apijson.cn:8080/get/{"Moment":{},"User":{"id@":"Moment%252FuserId"}})
+
+返回:
+{
+ "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"
+}
+
+
+
+
+#### 获取类似微信朋友圈的动态列表
+请求:
+{
+ "[]":{ //请求一个数组
+ "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 完整引用赋值路径
+ }
+ }
+ }
+}
+
+
+[点击这里测试](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"}}}})
+
+返回:
+{
+ "[]":[
+ {
+ "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"
+}
+
+
+
+ [GIF] APIJSON 各种多表关联查询:一对一、一对多、多对一、各种条件 等
+
+
+
+
+
+
+
+ [GIF] APIJSON 各种 JOIN:< LEFT JOIN, & INNER JOIN 等
+
+
+
+
+
+
+
+ [GIF] APIJSON 各种子查询:@from@ FROM, key@ =, key>@ >, key{}@ IN, key}{@ EXISTS 等
+
+
+
+
+
+
+
+ [GIF] APIJSON 部分功能演示集合,由浅入深、由简单到复杂
+
+
+
+
+
+
+[在线测试](http://apijson.cn/api)
+
+
+
+
+## 2.对比传统RESTful方式
+
+### 2.1 开发流程
+ 开发流程 | 传统方式 | APIJSON
+-------- | ------------ | ------------
+ 接口传输 | 等后端编辑接口,然后更新文档,前端再按照文档编辑请求和解析代码 | 前端按照自己的需求编辑请求和解析代码。
没有接口,更不需要文档!前端再也不用和后端沟通接口或文档问题了!
+ 兼容旧版 | 后端增加新接口,用v2表示第2版接口,然后更新文档 | 什么都不用做!
+
+
+
+### 2.2 前端请求