Skip to content

Commit 5756320

Browse files
committed
Server:去除返回的Array中count,page字段
1 parent 43c22ab commit 5756320

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • APIJSON(Server)/APIJSON(Eclipse_JEE)/src/main/java/zuo/biao/apijson/server

‎APIJSON(Server)/APIJSON(Eclipse_JEE)/src/main/java/zuo/biao/apijson/server/RequestParser.java‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ private JSONObject getArray(String parentPath, QueryConfig parentConfig, String
558558
if (count <= 0 || count > 100) {//count最大为100
559559
count = 100;
560560
}
561-
561+
562562
//最好先获取第一个table的所有项(where条件),填充一个列表?
563563
Set<String> set = request.keySet();
564564
if (count <= 0 || count > 10) {//10以下不优化长度
@@ -625,9 +625,6 @@ private JSONObject getArray(String parentPath, QueryConfig parentConfig, String
625625
}
626626
}
627627
} else {
628-
// request.remove(JSONRequest.KEY_PAGE);
629-
// request.remove(JSONRequest.KEY_COUNT);
630-
631628
for (String key : set) {
632629
value = request.get(key);
633630
if (value instanceof JSONObject) {//JSONObject,往下一级提取
@@ -649,6 +646,11 @@ private JSONObject getArray(String parentPath, QueryConfig parentConfig, String
649646

650647
System.out.println(TAG + "getArray return " + JSON.toJSONString(transferredRequest) + "\n>>>>>>>>>>>>>>>\n\n\n");
651648

649+
if (parseRelation == false && isInRelationMap(path) == false) {//parseRelation == true时不会添加进去
650+
transferredRequest.remove(JSONRequest.KEY_PAGE);
651+
transferredRequest.remove(JSONRequest.KEY_COUNT);
652+
}
653+
652654
return transferredRequest;
653655
}
654656

0 commit comments

Comments
 (0)