Skip to content

Commit c6e9c4b

Browse files
committed
Server:新增支持从requestObject中通过引用赋值来取值
1 parent 214da6e commit c6e9c4b

File tree

1 file changed

+15
-2
lines changed
  • APIJSON-Java-Server/APIJSON-Eclipse/src/main/java/zuo/biao/apijson/server

1 file changed

+15
-2
lines changed

APIJSON-Java-Server/APIJSON-Eclipse/src/main/java/zuo/biao/apijson/server/Parser.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,21 @@ private Object getValueByPath(String valuePath) {
843843
}
844844
}
845845

846-
Log.i(TAG, "getValueByPath return parent == null ? valuePath : parent.get(keys[keys.length - 1]); >> ");
847-
return parent == null ? valuePath : parent.get(keys[keys.length - 1]);
846+
if (parent != null) {
847+
Log.i(TAG, "getValueByPath >> get from queryResultMap >> return parent.get(keys[keys.length - 1]);");
848+
return parent.get(keys[keys.length - 1]); //TODO 值为null是否应该报错? NotExistExeption
849+
}
850+
851+
852+
//从requestObject中取值
853+
target = getValue(requestObject, StringUtil.splitPath(valuePath));
854+
if (target != null) {
855+
Log.i(TAG, "getValueByPath >> getValue >> return target = " + target);
856+
return target;
857+
}
858+
859+
Log.i(TAG, "getValueByPath return valuePath;");
860+
return valuePath;
848861
}
849862

850863
//依赖引用关系 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

0 commit comments

Comments
 (0)