Skip to content

Commit fd39e18

Browse files
committed
Java:MultiDataSource 更新 APIAuto
1 parent e698b5f commit fd39e18

File tree

10 files changed

+977
-277
lines changed

10 files changed

+977
-277
lines changed

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
在常用功能上远超 Postman, Swagger, YApi, Rap 等其它各种 开源、商业 的 API 文档/测试 工具。<br />
2121
支持 HTTP GET/POST API,智能显示和切换;支持一键导入 Swagger, Rap, YApi 的用例和文档。<br />
2222
不仅适用于 RESTful、类 RESTful、GRPC 的 API,还是腾讯 [APIJSON](https://github.com/Tencent/APIJSON) 官方建议的文档与测试工具。<br />
23-
腾讯内部用户包括 互动娱乐、技术工程、云与智慧 等,外部用户包含 500强上市公司深圳传音、行业领头羊社保科技 等。
23+
腾讯内部用户包括 互动娱乐、技术工程、云与智慧 等,外部用户包含 工商银行某地分行、500强上市公司深圳传音、行业领头羊社保科技 等。
2424

2525
<h3 align="center" style="text-align:center;">
2626
腾讯 AI 测试圈子演讲(部分)
@@ -29,12 +29,16 @@
2929
![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/APIAuto/APIAuto_Tencent_TEG_AITestCircle_quick_and_slow.gif)
3030

3131

32-
#### 腾讯内先后被 TEG 工具开发组、微信支付部门、IEG 工具开发组、CDG 金融支付组 邀请分享了
32+
#### 腾讯内先后被 TEG 工具开发组、微信支付部门、IEG 工具开发组、CDG 金融支付组、IEG PC 游戏平台部 邀请分享了
3333
* APIAuto-机器学习 HTTP 接口工具
3434
* 零代码测试工具与实践(API•单元•UI)
3535
* 零代码开发和测试(API测试•单元测试•API开发)
3636
* 零代码开发和测试(API测试•单元测试•API开发)
37+
* 零代码开发和测试(接口测试•单元测试•接口开发)
3738

39+
#### 质效无双线上技术访谈-零代码智能测试工具实践介绍-第11期
40+
https://testwo.cn1.quickconnect.cn/vs/sharing/iiP8VK1C#!aG9tZV92aWRlby0xMQ==
41+
![https://testwo.cn1.quickconnect.cn/vs/sharing/iiP8VK1C#!aG9tZV92aWRlby0xMQ==](https://user-images.githubusercontent.com/5738175/179575169-de9cc578-6d90-4aec-bbf4-f28147277ed2.png)
3842

3943
#### 和华为云副总裁并列,QECon-全球软件质量&效能 大会分享总结
4044
零代码开发和测试 成为大会主会场回看预约海报唯一分会场演讲范例 <br /><br />
@@ -102,6 +106,10 @@ https://www.bilibili.com/video/BV1yv411p7Y4
102106
[Bilibili](https://space.bilibili.com/437134249/search/video?keyword=apiauto) <br />
103107
[优酷](https://i.youku.com/i/UNTg1NzI1MjQ4MA==)
104108

109+
### 相关推荐
110+
[别再生成测试代码了!](https://mp.weixin.qq.com/s/G1GVNhhFbSX5GoyRU6GURg)
111+
112+
<br/>
105113

106114
### 部署方法
107115

@@ -155,51 +163,46 @@ https://github.com/TommyLemon/APIAuto/issues/13
155163
更多常见问题 <br />
156164
https://github.com/TommyLemon/APIAuto
157165

166+
<br />
167+
158168
### 感谢开源
159169
* jsonon
160170
* editor.md
161171
* vue.js
162172

163-
164173
### 技术交流
165174
##### 关于作者
166175
[https://github.com/TommyLemon](https://github.com/TommyLemon)<br />
176+
<img width="1279" alt="image" src="https://user-images.githubusercontent.com/5738175/189525500-5fe3ba45-c2b3-4df9-9607-c84120111e3c.png">
167177

168-
##### QQ群聊
169-
734652054(新)<a target="_blank" style="bottom:2px;padding-top:4px" href="https://qm.qq.com/cgi-bin/qm/qr?k=rJLwYzITdoQBfiGUOjMrM3eJDyks1tJP&jump_from=webapi"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="APIJSON-Free" title="APIJSON技术讨论群" style="bottom:2px;margin-top:4px" /></a>
170-
607020115(旧)<a target="_blank" style="bottom:2px;padding-top:4px" href="https://qm.qq.com/cgi-bin/qm/qr?k=1wnUodOM6ngXnl0rubf06DuAUbOX-u44&jump_from=webapi"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="APIJSON-Fee" title="APIJSON付费解决群" style="bottom:2px;margin-top:4px" /></a>
178+
##### QQ 群聊
179+
607020115(群1)<a target="_blank" style="bottom:2px;padding-top:4px" href="https://qm.qq.com/cgi-bin/qm/qr?k=1wnUodOM6ngXnl0rubf06DuAUbOX-u44&jump_from=webapi"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="APIJSON-Fee" title="APIJSON技术群1" style="bottom:2px;margin-top:4px" /></a>
180+
734652054(群2)<a target="_blank" style="bottom:2px;padding-top:4px" href="https://qm.qq.com/cgi-bin/qm/qr?k=rJLwYzITdoQBfiGUOjMrM3eJDyks1tJP&jump_from=webapi"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="APIJSON-Free" title="APIJSON技术群2" style="bottom:2px;margin-top:4px" /></a>
171181

172182
如果有什么问题或建议可以 [提ISSUE](https://github.com/TommyLemon/APIAuto/issues) 或 加群,交流技术,分享经验。<br >
173183
如果你解决了某些bug,或者新增了一些功能,欢迎 [贡献代码](https://github.com/TommyLemon/APIAuto/pulls),感激不尽。
174-
<br />
175-
<br />
176-
177184

178185
### 其它项目
179186

180-
[APIJSON](https://github.com/Tencent/APIJSON) 腾讯零代码、热更新、全自动 ORM 库 🏆 后端接口和文档自动化,前端(客户端) 定制返回 JSON 的数据和结构
187+
[APIJSON](https://github.com/Tencent/APIJSON) 腾讯零代码、全功能、强安全 ORM 库 🏆 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构
181188

182189
[UnitAuto](https://github.com/TommyLemon/UnitAuto) 机器学习单元测试平台,零代码、全方位、自动化 测试 方法/函数 的正确性和可用性
183190

184-
[APIJSON.NET](https://github.com/liaozb/APIJSON.NET) C# 版 APIJSON ,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite
191+
[SQLAuto](https://github.com/TommyLemon/SQLAuto) 智能零代码自动化测试 SQL 语句执行结果的数据库工具
185192

186-
[apijson-go](https://gitee.com/tiangao/apijson-go) Go 版 APIJSON ,支持单表查询、数组查询、多表一对一关联查询、多表一对多关联查询 等
193+
[APIJSON.NET](https://github.com/liaozb/APIJSON.NET) C# 版 APIJSON ,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite
187194

188-
[APIJSON-php](https://github.com/xianglong111/APIJSON-php) PHP 版 APIJSON,基于 ThinkPHP,支持 MySQL, PostgreSQL, SQL Server, Oracle
195+
[apijson-go](https://github.com/j2go/apijson-go) Go 版 APIJSON ,支持单表查询、数组查询、多表一对一关联查询、多表一对多关联查询
189196

190-
[apijson-php](https://github.com/qq547057827/apijson-php) PHP 版 APIJSON,基于 ThinkPHP,支持 MySQL, PostgreSQL, SQL Server, Oracle 等
197+
[apijson-hyperf](https://github.com/kvnZero/hyperf-APIJSON) PHP 版 APIJSON,基于 Hyperf 支持 MySQL
191198

192-
[apijson-node](https://github.com/kevinaskin/apijson-node) 字节跳动工程师开源的 Node.ts 版 APIJSON,提供 nestjs 和 typeorm 的 Demo
199+
[apijson-node](https://github.com/kevinaskin/apijson-node) Node.ts 版 APIJSON,提供 nestjs 和 typeorm 的 Demo,由字节跳动工程师开发
193200

194201
[uliweb-apijson](https://github.com/zhangchunlin/uliweb-apijson) Python 版 APIJSON,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite 等
195202

196-
[APIJSONParser](https://github.com/Zerounary/APIJSONParser) 第三方 APIJSON 解析器,将 JSON 动态解析成 SQL
197-
198-
[APIJSON-ToDo-Demo](https://github.com/jerrylususu/apijson_todo_demo) 一个简单的 todo 示例项目,精简数据,简化上手流程,带自定义鉴权逻辑
199-
200203
[apijson-practice](https://github.com/vcoolwind/apijson-practice) BAT 技术专家开源的 APIJSON 参数校验注解 Library 及相关 Demo
201204

202-
[apijson-learn](https://github.com/rainboy-learn/apijson-learn) APIJSON 学习笔记和源码解析
205+
[Android-ZBLibrary](https://github.com/TommyLemon/Android-ZBLibrary) Android MVP 快速开发框架,Demo 全面,注释详细,使用简单,代码严谨
203206

204207

205208
### 持续更新

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License.*/
1414

15+
if (typeof window == 'undefined') {
16+
try {
17+
eval(`
18+
var StringUtil = require("./StringUtil");
19+
var JSONObject = require("./JSONObject");
20+
`)
21+
} catch (e) {
22+
console.log(e)
23+
}
24+
}
1525

1626
/**util for generate code
1727
* @author Lemon
@@ -5865,7 +5875,7 @@ var CodeUtil = {
58655875
OWNER: '拥有者',
58665876
ADMIN: '管理员'
58675877
},
5868-
DATABASE_KEYS: ['MYSQL', 'POSTGRESQL', 'SQLSERVER', 'ORACLE', 'DB2', 'CLICKHOUSE', 'SQLITE'],
5878+
DATABASE_KEYS: ['MYSQL', 'POSTGRESQL', 'SQLSERVER', 'ORACLE', 'DB2', 'DAMENG', 'CLICKHOUSE', 'SQLITE', 'TDENGINE'],
58695879

58705880
/**获取请求JSON的注释
58715881
* @param tableList
@@ -6716,4 +6726,8 @@ var CodeUtil = {
67166726
return (targetType == 'number' && realType == 'integer') || (targetType == 'string' && ['date', 'time', 'datetime'].indexOf(realType) >= 0);
67176727
}
67186728

6729+
};
6730+
6731+
if (typeof module == 'object') {
6732+
module.exports = CodeUtil;
67196733
}

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@
1919
var JSONObject = {
2020
TAG: 'JSONObject',
2121

22+
log: function (tag, msg) {
23+
24+
},
25+
26+
isEmpty: function (obj) {
27+
return obj == null || Object.keys(obj).length <= 0;
28+
},
29+
2230
/**判断key是否为表名
2331
* @param key
2432
* @return
2533
*/
2634
isTableKey: function(key, value, isRestful) {
27-
log(this.TAG, 'isTableKey typeof key = ' + (typeof key));
35+
JSONObject.log(this.TAG, 'isTableKey typeof key = ' + (typeof key));
2836
if (key == null) {
2937
return false;
3038
}
@@ -44,7 +52,7 @@ var JSONObject = {
4452
* @return
4553
*/
4654
isArrayKey: function(key, value, isRestful) {
47-
log(this.TAG, 'isArrayKey typeof key = ' + (typeof key));
55+
JSONObject.log(this.TAG, 'isArrayKey typeof key = ' + (typeof key));
4856

4957
if (key == null) {
5058
return false;
@@ -110,13 +118,16 @@ var JSONObject = {
110118
}
111119

112120
return {
113-
method,
114-
isRestful,
115-
tag,
121+
method: method,
122+
isRestful: isRestful,
123+
tag: tag,
116124
table: startName
117125
}
118126
}
119127

120-
}
128+
};
121129

122-
//TODO 取消注释 Object.freeze(JSONObject) //不可修改
130+
if (typeof module == 'object') {
131+
module.exports = JSONObject;
132+
}
133+
//TODO 取消注释 Object.freeze(JSONObject) //不可修改

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,5 +467,8 @@ function newArrayString(table, json, count, page) {
467467
+ table + "\":" + JSON.stringify(json) + "}}";
468468
}
469469

470+
if (typeof module == 'object') {
471+
module.exports = this;
472+
}
470473

471474
//常用请求>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
* @author Lemon
1818
*/
1919

20+
if (typeof window == 'undefined') {
21+
try {
22+
eval(`
23+
var StringUtil = require("./StringUtil");
24+
var JSONObject = require("./JSONObject");
25+
`)
26+
} catch (e) {
27+
console.log(e)
28+
}
29+
}
2030

2131
//状态信息,非GET请求获得的信息<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2232

@@ -59,8 +69,19 @@ var JSONResponse = {
5969
* @param code
6070
* @return
6171
*/
62-
isSuccess: function(code) {
63-
return code == CODE_SUCCESS;
72+
isSuccess: function(obj) {
73+
if (obj == null) {
74+
return false
75+
}
76+
77+
if (typeof obj == 'number') {
78+
return obj == CODE_SUCCESS;
79+
}
80+
if (obj instanceof Object && obj instanceof Array == false) {
81+
return obj.code == CODE_SUCCESS;
82+
}
83+
84+
return false
6485
},
6586

6687
/**校验服务端是否存在table
@@ -1544,4 +1565,8 @@ var JSONResponse = {
15441565
return value;
15451566
}
15461567

1568+
};
1569+
1570+
if (typeof module == 'object') {
1571+
module.exports = JSONResponse;
15471572
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ var StringUtil = {
173173
return arr == null ? '' : arr.join(separator)
174174
}
175175

176+
};
177+
178+
if (typeof module == 'object') {
179+
module.exports = StringUtil;
176180
}
177181

178-
//校正(自动补全等)字符串>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
182+
//校正(自动补全等)字符串>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[0218/150154:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:6004
2+
[0218/150154:ERROR:node_debugger.cc(86)] Cannot start debugger server
3+
[0221/153307:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:6004
4+
[0221/153307:ERROR:node_debugger.cc(86)] Cannot start debugger server
5+
[0223/144750:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:6004
6+
[0223/144751:ERROR:node_debugger.cc(86)] Cannot start debugger server

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
</div>
172172
<div class="left-panel">
173173
<ul v-show="isTestCaseShow" class="historys" style="width: 100%;height: 100%;overflow: hidden;overflow-y: scroll;padding-bottom: 50px">
174-
<li v-for="(item, index) in testCases" >
174+
<li v-for="(item, index) in testCases" :id="'docItem' + index" >
175175
<div style="display: inline-table">
176176
<button v-show="types != null && types.length > 1" style="width: 48px;margin-right: 6px;padding: 0px;position: relative" id="vDocType" @click="restoreRemoteAndTest(index, item)">{{ getTypeName(item.Document.type) }}</button>
177177
<a class="hint--rounded hint--no-animate" ref="testCaseTexts" @mouseover="setRequestHint(index, item)" href="javascript:void(0)" @click="restoreRemote(index, item)" :style="{ color: index == currentDocIndex ? 'black' : 'gray' }"> {{(item.Document.version > 0 ? 'V' + item.Document.version : 'V*') + ' ' + item.Document.name + ' ' + item.Document.url}}</a>
@@ -321,7 +321,7 @@
321321

322322
<!-- 临时生成的配置子项 -->
323323
<ul v-show="isRandomSubListShow" class="historys" style="width: 100%;height: 100%;overflow: hidden;overflow-y: scroll; padding-bottom: 100px">
324-
<li style="width: 100%" v-for="(item, index) in randomSubs" >
324+
<li style="width: 100%" v-for="(item, index) in randomSubs" :id="'randomSubItem' + index" >
325325
<a v-show="! isRandomEditable" class="hint--rounded hint--no-animate" ref="randomSubTexts" @mouseover="setRequestHint(index, item, true)" href="javascript:void(0)" @click="restoreRandom(index, item)" :style="{ color: index == currentRandomSubIndex ? 'black' : 'gray' }">{{ (item.Random || {}).name }}</a>
326326
<input v-show="isRandomEditable" style="width: 96%" v-model="(item.Random || {}).name" @keyup="doOnKeyUp(event, 'randomSub', false, item)" />
327327

@@ -351,7 +351,7 @@
351351

352352
<!-- 持久化存储的配置项 -->
353353
<ul v-show="isRandomListShow" class="historys" style="width: 100%;height: 100%;overflow: hidden;overflow-y: scroll;padding-bottom: 100px">
354-
<li style="width: 100%; display: inline-table" v-for="(item, index) in randoms" >
354+
<li style="width: 100%; display: inline-table" v-for="(item, index) in randoms" :id="'randomItem' + index" >
355355
<input v-model="(item.Random || {}).count" style="min-width: 12px; max-width: 30px; width: auto; text-align: center" type="number" @keyup="doOnKeyUp(event, 'random', false, item)" />
356356
<a style="margin-left: 4px; "></a>
357357
<a v-show="! isRandomEditable" style="top: 13px; left: 68px; position: absolute" class="hint--rounded hint--no-animate" ref="randomTexts" @mouseover="setRequestHint(index, item, true)" href="javascript:void(0)" @click="restoreRandom(index, item)" :style="{ color: index == currentRandomIndex ? 'black' : 'gray' }">{{ (item.Random || {}).name }}</a>
@@ -579,7 +579,7 @@
579579
</div>
580580

581581
<!--<div class="statement">-->
582-
<!--Copyright ©2016-2021 APIJSON.cn All right reserved.-->
582+
<!--Copyright ©2016-2022 APIJSON.cn All right reserved.-->
583583
<!--<a href="https://beian.miit.gov.cn/" target="_blank">-->
584584
<!--<span >粤ICP备18005508号-1.</span>-->
585585
<!--</a>-->

0 commit comments

Comments
 (0)