Commit c98f28bf authored by 张永's avatar 张永

merge master

parents e4030fe8 2f3d9ebc
#! /usr/bin/env python #! /usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# __author__ = "chenwei" # __author__ = "chenwei"
# Date: 2019/2/14 # Date: 2019/2/15
from utils.base import APIView from utils.base import APIView
from utils.logger import error_logger from utils.logger import error_logger
...@@ -17,4 +17,4 @@ class SuggestionListView(APIView): ...@@ -17,4 +17,4 @@ class SuggestionListView(APIView):
except Exception as e: except Exception as e:
error_logger.error(u'获取建议列表失败%s', e) error_logger.error(u'获取建议列表失败%s', e)
raise raise
return data return data
\ No newline at end of file
...@@ -48,8 +48,9 @@ class TagSearchView(APIView): ...@@ -48,8 +48,9 @@ class TagSearchView(APIView):
offset, count = get_offset_count(request) offset, count = get_offset_count(request)
name = request.GET.get('name') name = request.GET.get('name')
platform = request.GET.get('platform') platform = request.GET.get('platform')
collection = request.GET.get('collection')
try: try:
data = self.rpc['venus/sun/tag/search'](offset=offset, count=count, name=name, platform=platform).unwrap() data = self.rpc['venus/sun/tag/search'](offset=offset, count=count, name=name, platform=platform, collection=collection).unwrap()
except Exception as e: except Exception as e:
raise e raise e
return { return {
......
...@@ -39,7 +39,7 @@ class TagUpdateOrCreateView(APIView): ...@@ -39,7 +39,7 @@ class TagUpdateOrCreateView(APIView):
try: try:
data = self.rpc['venus/sun/tag/get'](id=id).unwrap() data = self.rpc['venus/sun/tag/get'](id=id).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'获取标签%d信息失败%s'%(id, e)) error_logger.error(u'获取标签%d信息失败%s'%(int(id), e))
raise raise
if not data: if not data:
data = {} data = {}
...@@ -59,7 +59,9 @@ class TagUpdateOrCreateView(APIView): ...@@ -59,7 +59,9 @@ class TagUpdateOrCreateView(APIView):
'up_tags': up_tags, 'up_tags': up_tags,
'tagtypes': tagtypes, 'tagtypes': tagtypes,
'icon_url': request.POST.get('icon_url', '')[:-2], 'icon_url': request.POST.get('icon_url', '')[:-2],
'platform': request.POST.get('platform') 'platform': request.POST.get('platform'),
'collection': request.POST.get('collection'),
'alias': request.POST.get('alias')
} }
try: try:
data = self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap() data = self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap()
...@@ -119,4 +121,4 @@ class TagTypeUpdateOrCreateView(APIView): ...@@ -119,4 +121,4 @@ class TagTypeUpdateOrCreateView(APIView):
except Exception as e: except Exception as e:
error_logger.error(u'创建/编辑标签类型%d信息失败%s' % (id, e)) error_logger.error(u'创建/编辑标签类型%d信息失败%s' % (id, e))
raise raise
return data return data
\ No newline at end of file
...@@ -48,6 +48,8 @@ class TopicUpdateOrCreateView(APIView): ...@@ -48,6 +48,8 @@ class TopicUpdateOrCreateView(APIView):
id = request.POST.get('id', '') id = request.POST.get('id', '')
topic_images = list(map(lambda x: x[:-2], json.loads(request.POST.get('topic_images', [])))) topic_images = list(map(lambda x: x[:-2], json.loads(request.POST.get('topic_images', []))))
tag_ids = list(map(lambda x: x.split(':')[0], json.loads(request.POST.get('tags', '[]')))) tag_ids = list(map(lambda x: x.split(':')[0], json.loads(request.POST.get('tags', '[]'))))
collection_tag_ids = list(map(lambda x: x.split(':')[0], json.loads(request.POST.get('collection_tags', '[]'))))
data = { data = {
'topic_images': topic_images, 'topic_images': topic_images,
'video_url': request.POST.get('video_url', ''), 'video_url': request.POST.get('video_url', ''),
...@@ -58,6 +60,7 @@ class TopicUpdateOrCreateView(APIView): ...@@ -58,6 +60,7 @@ class TopicUpdateOrCreateView(APIView):
'user_id': request.POST.get('user', '').split(':')[0], 'user_id': request.POST.get('user', '').split(':')[0],
'star_id': request.POST.get('star', '').split(':')[0], 'star_id': request.POST.get('star', '').split(':')[0],
'tag_ids': tag_ids, 'tag_ids': tag_ids,
'collection_tag_ids': collection_tag_ids,
'is_online': int(request.POST.get('is_online')), 'is_online': int(request.POST.get('is_online')),
'drop_score': int(request.POST.get('drop_score')), 'drop_score': int(request.POST.get('drop_score')),
'has_image': 1 if topic_images else 0, 'has_image': 1 if topic_images else 0,
......
...@@ -98,6 +98,7 @@ urlpatterns = [ ...@@ -98,6 +98,7 @@ urlpatterns = [
url(r'^tag/tagtype/create$', TagTypeUpdateOrCreateView.as_view()), url(r'^tag/tagtype/create$', TagTypeUpdateOrCreateView.as_view()),
url(r'^tag/tagtype/detail$', TagTypeUpdateOrCreateView.as_view()), url(r'^tag/tagtype/detail$', TagTypeUpdateOrCreateView.as_view()),
# 扫脸相关
url(r'^face/star/create$', FaceStarEdit.as_view()), url(r'^face/star/create$', FaceStarEdit.as_view()),
url(r'^face/star/list$', StarListView.as_view()), url(r'^face/star/list$', StarListView.as_view()),
url(r'^face/star/list/update$', StarListView.as_view()), url(r'^face/star/list/update$', StarListView.as_view()),
...@@ -108,7 +109,6 @@ urlpatterns = [ ...@@ -108,7 +109,6 @@ urlpatterns = [
url(r'^face/part/list/update$', FacePartListView.as_view()), url(r'^face/part/list/update$', FacePartListView.as_view()),
url(r'^face/part/type_list$', FacePartTypeListView.as_view()), url(r'^face/part/type_list$', FacePartTypeListView.as_view()),
# 文案相关 # 文案相关
url(r'^advertise/edit', AdvertiseCreateView.as_view()), url(r'^advertise/edit', AdvertiseCreateView.as_view()),
url(r'^advertise/list$', AdvertiseListView.as_view()), url(r'^advertise/list$', AdvertiseListView.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