Commit 13353ac3 authored by haowang's avatar haowang

tools api add post params to suit more data form

parent f864ce07
......@@ -79,11 +79,14 @@ class BatchCreateTopicWithAiFashionTag(APIView):
def post(self, request):
json_file = request.FILES.get('file')
if not json_file:
tag_infos = request.POST.get('tag_infos')
if not json_file and not tag_infos:
return {'message': u'上传失败,请重新上传', 'code': 500}
json_data = json.load(json_file)
self.rpc['venus/sun/tools/batch_create_topic_with_ai_fashion_tag'](infos=json_data).unwrap()
if json_file:
json_data = json.load(json_file)
self.rpc['venus/sun/tools/batch_create_topic_with_ai_fashion_tag'](infos=json_data).unwrap()
if tag_infos:
self.rpc['venus/sun/tools/batch_create_topic_with_ai_fashion_tag'](infos=tag_infos).unwrap()
return {'message': u'上传成功', 'code': 200}
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