Commit 6f52ffab authored by haowang's avatar haowang

add ai fashion insert api

parent c092e4ed
import time
import json
from utils.base import APIView
from gm_upload import upload, upload_file
from openpyxl import load_workbook
......@@ -71,3 +72,18 @@ class BatchUpdateTopicTag(APIView):
self.rpc['venus/sun/tools/batch_update_topic_tags'](topic_infos=topic_infos).unwrap()
return {'message': u'上传成功', 'code': 200}
class BatchCreateTopicWithAiFashionTag(APIView):
def post(self, request):
json_file = request.FILES.get('file')
if not json_file:
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()
return {'message': u'上传成功', 'code': 200}
......@@ -144,6 +144,7 @@ urlpatterns = [
# 工具
url(r'^tools/virtual_vote$', VirtualVote.as_view()),
url(r'^tools/batch_update_topic_tag$', BatchUpdateTopicTag.as_view()),
url(r'^tools/batch_create_topic_with_ai_fashion_tag$', BatchCreateTopicWithAiFashionTag.as_view()),
]
......
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