Skip to content

Commit bd52f85

Browse files
committed
APIAuto: 解决改 APIJSON 相关类泛型误改了 APIAuto 源码的
1 parent 6fe9c7c commit bd52f85

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -972,13 +972,13 @@ var CodeUtil = {
972972

973973
s += '\n\n//回调实体类'
974974
+ '\n@Keep'
975-
+ '\nopen class ' + responseType + '<T, M, L> : BaseResponse<T, M, L> {'
975+
+ '\nopen class ' + responseType + '<T> : BaseResponse<T> {'
976976
+ '\n' + nextPadding + '@Transient'
977977
+ '\n' + nextPadding + 'open var ' + varName + ': ' + dataType + CodeUtil.initEmptyValue4Type(dataType, true, true) + '\n'
978978
+ '\n}\n'
979979
+ '\n//通用 HTTP 解析实体基类,全局存一份'
980980
+ '\n@Keep'
981-
+ '\nopen class BaseResponse<T, M, L> {'
981+
+ '\nopen class BaseResponse<T> {'
982982
+ '\n' + nextPadding + '@Transient'
983983
+ '\n' + nextPadding + 'open var code: Int' + CodeUtil.initEmptyValue4Type('Int', true, true) + '\n'
984984
+ '\n' + nextPadding + '@Transient'
@@ -1166,40 +1166,40 @@ var CodeUtil = {
11661166
}
11671167

11681168
s += '\n\n' +
1169-
'public class ' + responseType + '<T, M, L> extends Response<T, M, L> {\n' +
1169+
'public class ' + responseType + '<T> extends Response<T> {\n' +
11701170
nextPrefix + 'private ' + dataType + ' ' + varName + ';\n\n' +
11711171
nextPrefix + 'public '+ dataType + ' get' + modelName + '() {\n' +
11721172
nextNextPrefix + 'return ' + varName + ';\n' +
11731173
nextPrefix + '}\n' +
1174-
nextPrefix + 'public ' + responseType + '<T, M, L> set' + modelName + '(' + dataType + ' ' + varName + ') {\n' +
1174+
nextPrefix + 'public ' + responseType + '<T> set' + modelName + '(' + dataType + ' ' + varName + ') {\n' +
11751175
nextNextPrefix + 'this.' + varName + ' = ' + varName + ';\n' +
11761176
nextNextPrefix + 'return this;\n' +
11771177
nextPrefix + '}\n' +
11781178
'}';
11791179

11801180
s += '\n\n' +
1181-
'public class Response<T, M, L> {\n' +
1181+
'public class Response<T> {\n' +
11821182
nextPrefix + 'private int code;\n' +
11831183
nextPrefix + 'private String msg;\n' +
11841184
nextPrefix + 'private T data;\n\n' +
11851185
nextPrefix + 'public int getCode() {\n' +
11861186
nextNextPrefix + 'return code;\n' +
11871187
nextPrefix + '}\n' +
1188-
nextPrefix + 'public Response<T, M, L> setCode(int code) {\n' +
1188+
nextPrefix + 'public Response<T> setCode(int code) {\n' +
11891189
nextNextPrefix + 'this.code = code;\n' +
11901190
nextNextPrefix + 'return this;\n' +
11911191
nextPrefix + '}\n\n' +
11921192
nextPrefix + 'public String getMsg() {\n' +
11931193
nextNextPrefix + 'return msg;\n' +
11941194
nextPrefix + '}\n' +
1195-
nextPrefix + 'public Response<T, M, L> setMsg(String msg) {\n' +
1195+
nextPrefix + 'public Response<T> setMsg(String msg) {\n' +
11961196
nextNextPrefix + 'this.msg = msg;\n' +
11971197
nextNextPrefix + 'return this;\n' +
11981198
nextPrefix + '}\n\n' +
11991199
nextPrefix + 'public T getData() {\n' +
12001200
nextNextPrefix + 'return data;\n' +
12011201
nextPrefix + '}\n' +
1202-
nextPrefix + 'public Response<T, M, L> setData(T data) {\n' +
1202+
nextPrefix + 'public Response<T> setData(T data) {\n' +
12031203
nextNextPrefix + 'this.data = data;\n' +
12041204
nextNextPrefix + 'return this;\n' +
12051205
nextPrefix + '}\n' +
@@ -6783,7 +6783,7 @@ res_data = rep.json()
67836783
var typeOfValue = CodeUtil.getType4Request(value);
67846784
var isValueNotArray = typeOfValue != 'array';
67856785
var isValueNotObject = typeOfValue != 'object';
6786-
6786+
67876787
if (standardObj != null) {
67886788
var parentObj = pathKeys == null || pathKeys.length <= 0 ? null : JSONResponse.getStandardByPath(standardObj, pathKeys.slice(0, pathKeys.length - 1));
67896789
var targetValues = parentObj == null ? null : parentObj.values;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ jQuery.extend({
521521
parseJSON: function( data ) {
522522
// Attempt to parse using the native JSON parser first
523523
if ( window.JSON && window.JSON.parse ) {
524-
return window.parseJSON( data );
524+
return window.JSON.parse( data );
525525
}
526526

527527
if ( data === null ) {
@@ -555,7 +555,7 @@ jQuery.extend({
555555
return null;
556556
}
557557
try {
558-
if ( window.DOMParser<T, M, L> ) { // Standard
558+
if ( window.DOMParser ) { // Standard
559559
tmp = new DOMParser();
560560
xml = tmp.parseFromString( data , "text/xml" );
561561
} else { // IE

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/localforage.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Koa = require('koa');
22
//const cors = require('koa2-cors');
3-
const bodyParser<T, M, L> = require('koa-bodyparser');
3+
const bodyParser = require('koa-bodyparser');
44
// const Vue = require('vue');
55
const {getRequestFromURL, App} = require('./main');
66
// const { createBundleRenderer } = require('vue-server-renderer')
@@ -168,13 +168,13 @@ app.use(async ctx => {
168168
// })
169169
// ctx.req.addListener('end', function() {
170170
// console.log(json);
171-
var body = ctx.body || ctx.req.body || ctx.request.body || {} // || parseJSON(json) || {};
171+
var body = ctx.body || ctx.req.body || ctx.request.body || {} // || JSON.parse(json) || {};
172172
console.log(body);
173173
var isML = ctx.path == '/test/ml' || body.isML;
174174
var res = body.response;
175175
var stdd = body.standard;
176-
var response = typeof res != 'string' ? res : (StringUtil.isEmpty(res, true) ? null : parseJSON(res));
177-
var standard = typeof stdd != 'string' ? stdd : (StringUtil.isEmpty(stdd, true) ? null : parseJSON(stdd));
176+
var response = typeof res != 'string' ? res : (StringUtil.isEmpty(res, true) ? null : JSON.parse(res));
177+
var standard = typeof stdd != 'string' ? stdd : (StringUtil.isEmpty(stdd, true) ? null : JSON.parse(stdd));
178178
console.log('\n\nresponse = ' + JSON.stringify(response));
179179
console.log('\n\nstdd = ' + JSON.stringify(stdd));
180180
var compare = JSONResponse.compareResponse(null, standard, response || {}, '', isML, null, null, false) || {}

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/md/lib/codemirror/mode/rust/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h2>Rust mode</h2>
2929
<div><textarea id="code" name="code">
3030
// Demo code.
3131

32-
type foo<T, M, L> = int;
32+
type foo<T> = int;
3333
enum bar {
3434
some(int, foo<float>),
3535
none

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/md/lib/jquery.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)