Commit a96390e1 authored by litaolemo's avatar litaolemo

update

parent 1497f116
...@@ -38,8 +38,8 @@ data_type_dict = { ...@@ -38,8 +38,8 @@ data_type_dict = {
} }
dic_type = { dic_type = {
"cims/question/batch_create":"questions", "cims/question/batch_create":"questions",
"cims/answer/batch_create": "answers", "cims/answer/batch_create": "answers",
"cims/reply/batch_create":"replies" "cims/reply/batch_create":"replies"
} }
def post_muilty_data(data_list:typing.List,rpc_type:str) -> typing.Dict: def post_muilty_data(data_list:typing.List,rpc_type:str) -> typing.Dict:
...@@ -50,7 +50,7 @@ def post_muilty_data(data_list:typing.List,rpc_type:str) -> typing.Dict: ...@@ -50,7 +50,7 @@ def post_muilty_data(data_list:typing.List,rpc_type:str) -> typing.Dict:
for key in data_dict: for key in data_dict:
if key not in data_type_dict[rpc_type]: if key not in data_type_dict[rpc_type]:
data_dict.pop(key) data_dict.pop(key)
dic = {dic_type[rpc_type]:data_list} dic = {dic_type[rpc_type]: data_list}
invoker = create_default_invoker(debug=True).with_config(dump_curl=True) invoker = create_default_invoker(debug=True).with_config(dump_curl=True)
res = invoker[rpc_type](**dic) res = invoker[rpc_type](**dic)
...@@ -69,7 +69,7 @@ def post_single_data(data_dict:typing.Dict,rpc_type:str) -> typing.Dict: ...@@ -69,7 +69,7 @@ def post_single_data(data_dict:typing.Dict,rpc_type:str) -> typing.Dict:
if key not in data_type_dict[rpc_type]: if key not in data_type_dict[rpc_type]:
data_dict_copy.pop(key) data_dict_copy.pop(key)
print(data_dict_copy) print(data_dict_copy)
dic = {"questions":[data_dict_copy]} dic = {dic_type[rpc_type]: data_dict_copy}
invoker = create_default_invoker(debug=True).with_config(dump_curl=True) invoker = create_default_invoker(debug=True).with_config(dump_curl=True)
res = invoker[rpc_type](**dic) res = invoker[rpc_type](**dic)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment