Skip to content

Commit 149ebd1

Browse files
committed
修复构造List对象时从jsonRes中取的key名错误问题。
1 parent 2197a73 commit 149ebd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ def list_code_loop(code, count, total, n, ct):
6767

6868

6969
# 向代码模板中插入变量
70-
def build_list_construction(t, n):
70+
def build_list_construction(t, f, n):
7171
class_type = t.replace('List<', '').replace('>', '')
7272

73-
list_loop = 'jsonRes[\'%s\'] == null ? null : [];\n' % n
73+
list_loop = 'jsonRes[\'%s\'] == null ? null : [];\n' % f
7474
assert isinstance(t, str)
7575

7676
code = ''
@@ -124,7 +124,7 @@ def add_param_to_code(code, param):
124124

125125
# list类型处理,只需要修改construction中的输出方式
126126
elif t_code == 3:
127-
list_loop = build_list_construction(t, n)
127+
list_loop = build_list_construction(t, f, n)
128128

129129
code = code.replace('jsonRes[\'%s\'];' % f, list_loop)
130130

0 commit comments

Comments
 (0)