Commit 1497f116 authored by litaolemo's avatar litaolemo

update

parent 4d3cf927
......@@ -36,6 +36,11 @@ data_type_dict = {
"cims/answer/batch_create": ["platform","platform_id","platform_question_id","content","user_id","create_time","is_online"],
"cims/reply/batch_create": ["platform","platform_id","platform_answer_id","content","user_id","create_time","is_online"]
}
dic_type = {
"cims/question/batch_create":"questions",
"cims/answer/batch_create": "answers",
"cims/reply/batch_create":"replies"
}
def post_muilty_data(data_list:typing.List,rpc_type:str) -> typing.Dict:
headers = {
......@@ -45,7 +50,7 @@ def post_muilty_data(data_list:typing.List,rpc_type:str) -> typing.Dict:
for key in data_dict:
if key not in data_type_dict[rpc_type]:
data_dict.pop(key)
dic = {"questions":data_list}
dic = {dic_type[rpc_type]:data_list}
invoker = create_default_invoker(debug=True).with_config(dump_curl=True)
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