Commit 11ef5e7a authored by haowang's avatar haowang

fix code about api

parent 1397beca
......@@ -7,10 +7,10 @@ class BeautyListView(APIView):
def get(self, request):
offset, count = get_offset_count(request)
parent_word_id = request.GET.get('parent_word_id', None)
word_parent_id = request.GET.get('word_parent_id', None)
is_online = request.GET.get('is_online', None)
data = self.rpc['venus/sun/beauty/list'](offset=offset, count=count, parent_word_id=parent_word_id, is_online=is_online).unwrap()
data = self.rpc['venus/sun/beauty/list'](offset=offset, count=count, word_parent_id=word_parent_id, is_online=is_online).unwrap()
return data
......@@ -18,12 +18,12 @@ class BeautyCreateView(APIView):
def post(self, request):
url = request.POST.get('url', None)
parent_word_id = request.POST.get('parent_word_id', None)
word_parent_id = request.POST.get('word_parent_id', None)
if not url or not parent_word_id:
if not url or not word_parent_id:
return r'缺少参数'
data = self.rpc['venus/sun/beauty/add'](url=url, parent_word_id=parent_word_id).unwrap()
data = self.rpc['venus/sun/beauty/add'](url=url, word_parent_id=word_parent_id).unwrap()
return data
......@@ -33,12 +33,12 @@ class BeautyUpdateView(APIView):
def post(self, request):
id_ = request.POST.get('id', None)
url = request.POST.get('url', None)
parent_word_id = request.POST.get('parent_word_id', None)
word_parent_id = request.POST.get('word_parent_id', None)
if not id_:
return r'缺少参数'
data = self.rpc['venus/sun/beauty/edit'](id_=id_, url=url, parent_word_id=parent_word_id).unwrap()
data = self.rpc['venus/sun/beauty/edit'](id_=id_, url=url, word_parent_id=word_parent_id).unwrap()
if not data:
return r'更新失败'
......
......@@ -23,6 +23,9 @@ from .commons import *
from .pictorial import *
from .operation import *
from .tools import *
from .beauty import *
from .word_parent import *
from .activity import *
urlpatterns = [
......@@ -153,22 +156,22 @@ urlpatterns = [
url(r'^tools/batch_create_topic_with_ai_fashion_tag$', BatchCreateTopicWithAiFashionTag.as_view()),
# 母词
url(r'^word_parent/list$', VirtualVote.as_view()),
url(r'^word_parent/create$', VirtualVote.as_view()),
url(r'^word_parent/update$', VirtualVote.as_view()),
url(r'^word_parent/delete$', VirtualVote.as_view()),
url(r'^word_parent/list$', WordParentListView.as_view()),
url(r'^word_parent/create$', WordParentCreateView.as_view()),
url(r'^word_parent/update$', WordParentUpdateView.as_view()),
url(r'^word_parent/delete$', WordParentDeleteView.as_view()),
# 美图
url(r'^beauty/list$', VirtualVote.as_view()),
url(r'^beauty/create$', VirtualVote.as_view()),
url(r'^beauty/update$', VirtualVote.as_view()),
url(r'^beauty/delete$', VirtualVote.as_view()),
url(r'^beauty/list$', BeautyListView.as_view()),
url(r'^beauty/create$', BeautyCreateView.as_view()),
url(r'^beauty/update$', BeautyUpdateView.as_view()),
url(r'^beauty/delete$', BeautyDeleteView.as_view()),
# 活动
url(r'^activity/list$', VirtualVote.as_view()),
url(r'^activity/create$', VirtualVote.as_view()),
url(r'^activity/update$', VirtualVote.as_view()),
url(r'^activity/delete$', VirtualVote.as_view()),
url(r'^activity/list$', ActivityListView.as_view()),
url(r'^activity/create$', ActivityCreateView.as_view()),
url(r'^activity/update$', ActivityUpdateView.as_view()),
url(r'^activity/delete$', ActivityDeleteView.as_view()),
]
......
......@@ -19,9 +19,9 @@ class WordParentCreateView(APIView):
def post(self, request):
name = request.POST.get('name', None)
children_words = json.loads(request.POST.get('children_words', '[]'))
content_ad = request.POST.get('content_ad', None)
makeup_ad = request.POST.get('makeup_ad', None)
dress_ad = request.POST.get('dress_ad', None)
content_ad = request.POST.get('content_ad', '')
makeup_ad = request.POST.get('makeup_ad', '')
dress_ad = request.POST.get('dress_ad', '')
if not name:
return r'缺少参数'
......
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