Skip to content

Commit 7d7d4f9

Browse files
committed
优化自动生成封装JSON的Java代码中的tag和version
1 parent 12aee53 commit 7d7d4f9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apijson/CodeUtil.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ var CodeUtil = {
248248
},
249249

250250
onParseChildOther: function (key, value, index) {
251+
if (depth <= 0 && isSmart) {
252+
if (key == 'tag') {
253+
return '\n' + parentKey + '.setTag(' + CodeUtil.getJavaValue(name, key, value) + ');';
254+
}
255+
if (key == 'version') {
256+
return '\n' + parentKey + '.setVersion(' + CodeUtil.getJavaValue(name, key, value) + ');';
257+
}
258+
}
251259
return '\n' + parentKey + '.put("' + key + '", ' + CodeUtil.getJavaValue(name, key, value) + ');';
252260
}
253261
})

0 commit comments

Comments
 (0)