Skip to content

Commit a32d5f4

Browse files
committed
解决对 Response 校验只对最外层生效;移除已废弃的 StructureUtil 和 Test 的相关代码
1 parent da1b21d commit a32d5f4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
import apijson.orm.model.SysColumn;
7171
import apijson.orm.model.SysTable;
7272
import apijson.orm.model.Table;
73-
import apijson.orm.model.Test;
7473
import apijson.orm.model.TestRecord;
7574

7675
/**校验器(权限、请求参数、返回结果等)
@@ -121,7 +120,6 @@ public abstract class AbstractVerifier<T> implements Verifier<T>, IdCallback {
121120
SYSTEM_ACCESS_MAP.put(Function.class.getSimpleName(), getAccessMap(Function.class.getAnnotation(MethodAccess.class)));
122121
SYSTEM_ACCESS_MAP.put(Request.class.getSimpleName(), getAccessMap(Request.class.getAnnotation(MethodAccess.class)));
123122
SYSTEM_ACCESS_MAP.put(Response.class.getSimpleName(), getAccessMap(Response.class.getAnnotation(MethodAccess.class)));
124-
SYSTEM_ACCESS_MAP.put(Test.class.getSimpleName(), getAccessMap(Test.class.getAnnotation(MethodAccess.class)));
125123

126124
if (Log.DEBUG) {
127125
SYSTEM_ACCESS_MAP.put(Table.class.getSimpleName(), getAccessMap(Table.class.getAnnotation(MethodAccess.class)));
@@ -724,7 +722,12 @@ public static JSONObject verifyResponse(@NotNull final RequestMethod method, fin
724722
}
725723

726724
//解析
727-
return parse(method, name, target, response, database, schema, idKeyCallback, creator, callback != null ? callback : new OnParseCallback() {});
725+
return parse(method, name, target, response, database, schema, idKeyCallback, creator, callback != null ? callback : new OnParseCallback() {
726+
@Override
727+
protected JSONObject onParseJSONObject(String key, JSONObject tobj, JSONObject robj) throws Exception {
728+
return verifyResponse(method, key, tobj, robj, database, schema, idKeyCallback, creator, callback);
729+
}
730+
});
728731
}
729732

730733

0 commit comments

Comments
 (0)