Skip to content

Commit 5848342

Browse files
committed
Server:解决key@未获取到结果(返回path)时 Response同时存在key和key@
1 parent d1c0c59 commit 5848342

1 file changed

Lines changed: 8 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: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,6 @@ public static JSONObject fillTarget(RequestMethod method
309309
System.out.println(TAG + "filterTarget target == null || request == null >> return null;");
310310
return null;
311311
}
312-
// if (method == null) {
313-
// method = RequestMethod.GET;
314-
// }
315312

316313
/**方法三:遍历request,transferredRequest只添加target所包含的object
317314
* ,且移除target中DISALLOW_COLUMNS,期间判断NECESSARY_COLUMNS是否都有
@@ -535,7 +532,14 @@ && isInRelationMap(path) == false) {
535532
System.out.println("getObject key.endsWith(@) >> parseRelation = " + parseRelation);
536533
String replaceKey = getRealKey(requestMethod, key, false);
537534
if (parseRelation) {
538-
transferredRequest.put(replaceKey, getValueByPath(relationMap.get(getPath(path, replaceKey))));
535+
transferredRequest.remove(key);
536+
selfDefineKeyMap.remove(key);
537+
if (key.startsWith("@")) {
538+
selfDefineKeyMap.put(replaceKey, getValueByPath(relationMap.get(getPath(path, replaceKey))));
539+
} else {
540+
transferredRequest.put(replaceKey, getValueByPath(relationMap.get(getPath(path, replaceKey))));
541+
}
542+
539543
// relationMap.remove(path + SEPARATOR + key);
540544
updateRelation(path, getPath(path, replaceKey));//request结构已改变,需要更新依赖关系
541545
} else {

0 commit comments

Comments
 (0)