Skip to content

Commit a49f6b5

Browse files
committed
* 修改相应的返回规则
1 parent c32e6ac commit a49f6b5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,12 +1293,22 @@ else if (childKeys.length == 1 && JSONRequest.isTableKey(childKeys[0])) { //
12931293
* modify by gouchy chen
12941294
* 带有key[]格式时,也需要返回所有的字段
12951295
*/
1296+
12961297
if(childKeys == null || childKeys.length == 0 ) {
12971298
response.add(getValue(parent, null)); //null有意义
1298-
} else if(childKeys.length == 1 && parent.keySet().size() == 1) {
1299-
response.add(getValue(parent, null)); //null有意义
13001299
} else {
1301-
response.add(getValue(parent, childKeys)); //null有意义
1300+
List<String> needObjectList = new ArrayList<>();
1301+
for(String key : parent.keySet()) {
1302+
if(!key.startsWith("@") && !key.endsWith("@")) {
1303+
needObjectList.add(key);
1304+
}
1305+
}
1306+
if(needObjectList.size() == 1) {
1307+
response.add(getValue(parent, childKeys)); //null有意义
1308+
} else {
1309+
response.add(getValue(parent, null));
1310+
}
1311+
13021312
}
13031313
}
13041314

0 commit comments

Comments
 (0)