Skip to content

Commit 66c04e4

Browse files
committed
优化数据字典文档 schema 及自动生成 APIJSON 请求 JSON 的格式和内容,删除多余的 application.properties,修复 bug
1 parent 3bb1c5a commit 66c04e4

6 files changed

Lines changed: 120 additions & 98 deletions

File tree

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/application.properties

Whitespace-only changes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var CodeUtil = {
114114
}
115115

116116
return ks;
117-
}
117+
},
118118

119119
/**生成JSON的注释
120120
* @param reqStr //已格式化的JSON String

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,10 @@ var JSONResponse = {
553553
// }
554554

555555
if (tCode == null) {
556-
if (typeof rCode == 'number' && (rCode%10 != 0 || (rCode >= 400 && rCode < 600))) {
556+
if (rCode != JSONResponse.CODE_SUCCESS && rCode != 200) {
557557
return {
558558
code: JSONResponse.COMPARE_CODE_CHANGE, //未上传对比标准
559-
msg: '没有校验标准,且状态码 ' + rCode + ' 在 [400, 599] 内或不是 0, 200 等以 0 结尾的数',
559+
msg: '没有校验标准,且状态码 ' + rCode + ' 不是成功值!',
560560
path: folder == null ? '' : folder
561561
};
562562
}

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

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ var StringUtil = {
112112
],
113113

114114
isBizName: function(s) {
115-
if (typeof s != 'string' || s.trim().length < 3) {
115+
if (typeof s != 'string' || StringUtil.length(s) < 3) {
116116
return false;
117117
}
118-
if (StringUtil.isBigName(s) && || ! StringUtil.isConstName(s)) {
118+
if (StringUtil.isBigName(s) && ! StringUtil.isConstName(s)) {
119119
return true;
120120
}
121121
if (! StringUtil.isName(s)) {
@@ -137,7 +137,7 @@ var StringUtil = {
137137
return typeof s == 'string' && StringUtil.isBizName(s.replaceAll('-', ''));
138138
},
139139
isTableName: function(s) {
140-
if (StringUtil.isBigName(s) && || ! StringUtil.isConstName(s)) {
140+
if (StringUtil.isBigName(s) && ! StringUtil.isConstName(s)) {
141141
return true;
142142
}
143143
if (! StringUtil.isBizName(s)) {
@@ -259,7 +259,10 @@ var StringUtil = {
259259
return null;
260260
}
261261

262-
if (trim) {
262+
if (typeof s != 'string') {
263+
s = StringUtil.get(s);
264+
}
265+
else if (trim) {
263266
s = s.trim();
264267
}
265268

@@ -290,7 +293,10 @@ var StringUtil = {
290293
join: function (arr, separator) {
291294
return arr == null ? '' : arr.join(separator);
292295
},
293-
length: function (s) {
296+
length: function (s, trim) {
297+
if (trim && typeof s == 'string') {
298+
s = StringUtil.trim(s);
299+
}
294300
return s == null ? 0 : s.length;
295301
},
296302
limitLength: function (s, maxLen, ellipsize) {
@@ -519,8 +525,8 @@ var StringUtil = {
519525
return false;
520526
}
521527

522-
if ((key.startsWith('is') || key.startsWith('Is')) && /[a-z]/g.test(k) != true)
523-
|| (key.startsWith('IS') && /[A-Za-z]/g.test(k) != true) {
528+
if (((key.startsWith('is') || key.startsWith('Is')) && /[a-z]/g.test(k) != true)
529+
|| (key.startsWith('IS') && /[A-Za-z]/g.test(k) != true)) {
524530
return true;
525531
}
526532

@@ -529,13 +535,13 @@ var StringUtil = {
529535
return false;
530536
}
531537

532-
if ((key.startsWith('has') || key.startsWith('Has')) && /[a-z]/g.test(k) != true)
533-
|| (key.startsWith('HAS') && /[A-Za-z]/g.test(k) != true) {
538+
if (((key.startsWith('has') || key.startsWith('Has')) && /[a-z]/g.test(k) != true)
539+
|| (key.startsWith('HAS') && /[A-Za-z]/g.test(k) != true)) {
534540
return true;
535541
}
536542

537-
if ((key.startsWith('can') || key.startsWith('Can')) && /[a-z]/g.test(k) != true)
538-
|| (key.startsWith('CAN') && /[A-Za-z]/g.test(k) != true) {
543+
if (((key.startsWith('can') || key.startsWith('Can')) && /[a-z]/g.test(k) != true)
544+
|| (key.startsWith('CAN') && /[A-Za-z]/g.test(k) != true)) {
539545
return true;
540546
}
541547

@@ -544,8 +550,8 @@ var StringUtil = {
544550
return false;
545551
}
546552

547-
if ((key.startsWith('have') || key.startsWith('Have')) && /[a-z]/g.test(k) != true)
548-
|| (key.startsWith('HAVE') && /[A-Za-z]/g.test(k) != true) {
553+
if (((key.startsWith('have') || key.startsWith('Have')) && /[a-z]/g.test(k) != true)
554+
|| (key.startsWith('HAVE') && /[A-Za-z]/g.test(k) != true)) {
549555
return true;
550556
}
551557

@@ -554,8 +560,8 @@ var StringUtil = {
554560
return false;
555561
}
556562

557-
if ((key.startsWith('shall') || key.startsWith('Shall')) && /[a-z]/g.test(k) != true)
558-
|| (key.startsWith('SHALL') && /[A-Za-z]/g.test(k) != true) {
563+
if (((key.startsWith('shall') || key.startsWith('Shall')) && /[a-z]/g.test(k) != true)
564+
|| (key.startsWith('SHALL') && /[A-Za-z]/g.test(k) != true)) {
559565
return true;
560566
}
561567

@@ -564,13 +570,13 @@ var StringUtil = {
564570
return false;
565571
}
566572

567-
if ((key.startsWith('should') || key.startsWith('Should')) && /[a-z]/g.test(k) != true)
568-
|| (key.startsWith('SHOULD') && /[A-Za-z]/g.test(k) != true) {
573+
if (((key.startsWith('should') || key.startsWith('Should')) && /[a-z]/g.test(k) != true)
574+
|| (key.startsWith('SHOULD') && /[A-Za-z]/g.test(k) != true)) {
569575
return true;
570576
}
571577

572-
if ((key.startsWith('enable') || key.startsWith('Enable')) && /[a-z]/g.test(k) != true)
573-
|| (key.startsWith('ENABLE') && /[A-Za-z]/g.test(k) != true) {
578+
if (((key.startsWith('enable') || key.startsWith('Enable')) && /[a-z]/g.test(k) != true)
579+
|| (key.startsWith('ENABLE') && /[A-Za-z]/g.test(k) != true)) {
574580
return true;
575581
}
576582

@@ -579,8 +585,8 @@ var StringUtil = {
579585
return false;
580586
}
581587

582-
if ((key.startsWith('disable') || key.startsWith('Disable')) && /[a-z]/g.test(k) != true)
583-
|| (key.startsWith('DISABLE') && /[A-Za-z]/g.test(k) != true) {
588+
if (((key.startsWith('disable') || key.startsWith('Disable')) && /[a-z]/g.test(k) != true)
589+
|| (key.startsWith('DISABLE') && /[A-Za-z]/g.test(k) != true)) {
584590
return true;
585591
}
586592

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

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

782782
<!--格式化错误视图-->
783783
<div class="view-error" v-show="view == 'error'">
784-
<pre v-cloak>{{error.msg}}</pre>
784+
<pre style="max-height: 760px; overflow-x: scroll; overflow-y: scroll;" v-cloak>{{error.msg}}</pre>
785785
</div>
786786

787787
<!--diff视图-->

0 commit comments

Comments
 (0)