Skip to content

Commit dac86df

Browse files
committed
Java: MultiDatabase 更新内置 APIAuto
1 parent 3d181cf commit dac86df

File tree

5 files changed

+379
-48
lines changed

5 files changed

+379
-48
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
---
1818
敏捷开发最强大易用的 HTTP 接口工具,机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释。<br />
19+
提供集 文档、测试、Mock、调试、管理 于一体的一站式体验,还有一键 格式化、注释/取消注释 等高效易用的快捷键。<br />
1920
在常用功能上远超 Postman, Swagger, YApi, Rap 等其它各种 开源、商业 的 API 文档/测试 工具。<br />
2021
支持 HTTP GET/POST API,智能显示和切换;支持一键导入 Swagger, Rap, YApi 的用例和文档。<br />
2122
不仅适用于 RESTful、类 RESTful、GRPC 的 API,还是腾讯 [APIJSON](https://github.com/Tencent/APIJSON) 官方建议的文档与测试工具。<br />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
const TAG_REQUEST_UTIL = 'RequestUtil';
2222

23-
var URL_BASE = "http://localhost:8080"; // "http://apijson.cn:8080";// 基地址
23+
var URL_BASE = "http://localhost:8080"; // 基地址
2424
var URL_GET = URL_BASE + "/get"; // 常规获取数据方式
2525
var URL_HEAD = URL_BASE + "/head"; // 检查,默认是非空检查,返回数据总数
2626
var URL_GETS = URL_BASE + "/gets"; // 通过POST来GET数据,不显示请求内容和返回结果,一般用于对安全要求比较高的请求

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ var StringUtil = {
3232
* @return
3333
*/
3434
trim: function(s) {
35-
return StringUtil.get(s).trim();
35+
return s == null ? '' : s.trim();
3636
},
3737

3838
/**获取去掉所有空格后的string,为null则返回''
3939
* @param s
4040
* @return
4141
*/
4242
noBlank: function(s) {
43-
return StringUtil.get(s).replace(/ /g, '');
43+
return s == null ? '' : s.replace(/ /g, '');
4444
},
4545

4646
/**判断字符是否为空
@@ -55,11 +55,7 @@ var StringUtil = {
5555
if (trim) {
5656
s = s.trim();
5757
}
58-
if (s == '') {
59-
return true;
60-
}
61-
62-
return false;
58+
return s.length <= 0;
6359
},
6460

6561
/**判断是否为代码名称,只能包含字母,数字或下划线

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
<button v-show="types != null && types.length > 1" class="transfer" id="vType" :disabled="isEditResponse" @click="changeType()">{{ getTypeName(type) }}</button>
138138
<div style="height: 100%;display: flex;flex-grow: 1">
139139
<input class="url" id="vUrlComment" :disabled="isEditResponse" type="text" style="width: 100%; position: absolute; z-index: -100; color: darkseagreen;background: #0000;" />
140-
<input class="url" id="vUrl" :disabled="isEditResponse" type="text" @keyup="doOnKeyUp(event)" placeholder="请输入请求的接口地址" style="z-index: 0; background: #0000;" />
140+
<input class="url" id="vUrl" :disabled="isEditResponse" type="text" @copy="doOnCopy" @paste="doOnPaste" @keyup="doOnKeyUp(event)" placeholder="请输入请求的接口地址" style="z-index: 0; background: #0000;" />
141141
</div>
142142
<button class="send" id="vSend" @click="onClickSend()">{{ isEditResponse ? '模拟返回' : '发送请求' }}</button>
143143
</div>
@@ -195,7 +195,7 @@
195195
</textarea>
196196
<textarea v-show="! isEditResponse" id="vWarning" style="width: 100%; height: 100%; position: absolute; z-index: 0; color: orangered; background-color: #0000;" wrap="off" disabled>
197197
</textarea>
198-
<textarea id="vInput" @keyup="onChange(true)" style="width: 100%;height: 100%; position: absolute; z-index: 100; background: #0000;" wrap="off" placeholder="{ // 根对象,可在内部加 format,tag,version,@role,@database,@schema,@datasource,@explain,@cache 等全局关键词键值对
198+
<textarea id="vInput" @copy="doOnCopy" @paste="doOnPaste" @keyup="onChange(true)" style="width: 100%;height: 100%; position: absolute; z-index: 100; background: #0000;" wrap="off" placeholder="{ // 根对象,可在内部加 format,tag,version,@role,@database,@schema,@datasource,@explain,@cache 等全局关键词键值对
199199
'[]': { // 数组,可在内部加 count,page,query,join 等关键词键值对
200200
'count': 5, // 每页数量
201201
'page': 0, // 分页页码
@@ -251,7 +251,8 @@
251251
![](http://apijson.cn/images/logo-big.png)
252252
253253
## 快捷键
254-
Ctrl + I 或 Command + I 格式化 JSON
254+
Ctrl + I 或 Command + I 格式化 JSON,清除所有注释和无效空格、换行等;
255+
Ctrl + / 或 Command + / 对选中行 新增行注释 或 取消行注释;
255256
256257
#### 右上角设置项 > 预览请求输入框,显示对应的预览效果
257258
*/
@@ -262,10 +263,10 @@
262263
{
263264
"User": {
264265
"id": 82001
265-
},
266+
}, // 以上查一个对象,以下查一个数组,Comment.userId = User.id
266267
"[]": {
267-
"Comment": {
268-
"userId@": "User/id"
268+
Comment : {
269+
'userId@': "User/id"
269270
}
270271
}
271272
}
@@ -275,7 +276,8 @@
275276
注释可省略。行注释前必须有两个空格;段注释必须在 JSON 下方。
276277

277278
## 快捷键
278-
Ctrl + I 或 Command + I 格式化 JSON
279+
Ctrl + I 或 Command + I 格式化输入框,清除所有注释和无效空格、换行等;
280+
Ctrl + / 或 Command + / 对选中行 新增行注释 或 取消行注释;
279281

280282
#### 右上角设置项 > 预览请求输入框,显示对应的预览效果
281283
*/
@@ -388,7 +390,7 @@
388390
<a ></a>
389391
</div>
390392

391-
<textarea id="vRandom" style="width: 100%;height: 100%;" wrap="off"
393+
<textarea id="vRandom" @copy="doOnCopy" @paste="doOnPaste" style="width: 100%;height: 100%;" wrap="off"
392394
placeholder="# 常用:
393395
RANDOM_IN(val0:Any, val1:Any ...) // 从选项内随机取值
394396
RANDOM_INT(min:Integer, max:Integer) // 从范围内随机取整数
@@ -410,7 +412,12 @@
410412
@explain: ORDER_IN(true, false) // 顺序取值
411413
// 从数据库随机取值 []/Comment/toId: RANDOM_DB()
412414

413-
// 注释可省略,但如果未省略则前面两个空格必须;清空文本内容可查看规则。</textarea>
415+
// 注释可省略,但如果未省略则前面两个空格必须;清空文本内容可查看规则。
416+
417+
// ## 快捷键
418+
// Ctrl + I 或 Command + I 格式化文本,清除所有注释和无效空格、换行等;
419+
// Ctrl + / 或 Command + / 对选中行 新增行注释 或 取消行注释;
420+
</textarea>
414421
</div>
415422

416423

@@ -423,8 +430,11 @@
423430
</svg>
424431
</a>
425432
</div>
426-
<textarea id="vHeader" @keyup="onChange(true)" style="width: 100%;height: 100%;" wrap="off" placeholder="Authorization: Basic YWRtaW46YWRtaW4= // 示例,支持单行注释
427-
My-Header: 'Secret' + Math.random() // 示例,代码执行结果作为实际值,值为 fun(arg0, arg1..) 等包含函数名与括号的格式 "></textarea>
433+
<textarea id="vHeader" @copy="doOnCopy" @paste="doOnPaste" @keyup="onChange(true)" style="width: 100%;height: 100%;" wrap="off" placeholder="Authorization: Basic YWRtaW46YWRtaW4= // 示例,支持单行注释
434+
My-Header: 'Secret' + Math.random() // 示例,代码执行结果作为实际值,值为 fun(arg0, arg1..) 等包含函数名与括号的格式
435+
// ## 快捷键
436+
// Ctrl + I 或 Command + I 格式化文本,清除所有注释和无效空格、换行等;
437+
// Ctrl + / 或 Command + / 对选中行 新增行注释 或 取消行注释;"></textarea>
428438
</div>
429439

430440
</div>

0 commit comments

Comments
 (0)