Skip to content

Commit

Permalink
解决对 Response 校验只对最外层生效;移除已废弃的 StructureUtil 和 Test 的相关代码
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLemon committed Mar 20, 2021
1 parent da1b21d commit a32d5f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
import apijson.orm.model.SysColumn;
import apijson.orm.model.SysTable;
import apijson.orm.model.Table;
import apijson.orm.model.Test;
import apijson.orm.model.TestRecord;

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

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

//解析
return parse(method, name, target, response, database, schema, idKeyCallback, creator, callback != null ? callback : new OnParseCallback() {});
return parse(method, name, target, response, database, schema, idKeyCallback, creator, callback != null ? callback : new OnParseCallback() {
@Override
protected JSONObject onParseJSONObject(String key, JSONObject tobj, JSONObject robj) throws Exception {
return verifyResponse(method, key, tobj, robj, database, schema, idKeyCallback, creator, callback);
}
});
}


Expand Down

0 comments on commit a32d5f4

Please sign in to comment.