Commit 33ef6c13 authored by 杨成林's avatar 杨成林

Merge branch 'ycl/kyc' into 'master'

Ycl/kyc

See merge request alpha/sun!384
parents 138553b7 e43fb4a7
......@@ -231,3 +231,37 @@ class PictorialFollowsAdd(APIView):
return {
'message': '添加成功'
}
class PictorialTagAdd(APIView):
"""新增榜单tag"""
def post(self, request):
pictorial_ids = json.loads(request.POST.get('pictorial_ids', '[]'))
tag_id = int(request.POST.get('tag_id')) if request.POST.get('tag_id') else None
try:
self.rpc['venus/sun/pictorial/add_tag'](pictorial_ids=pictorial_ids, tag_id=tag_id).unwrap()
except Exception as e:
error_logger.error(u'操作失败%s' % (e))
raise
return {
'message': '添加成功'
}
class PictorialTagRm(APIView):
"""删除榜单tag"""
def post(self, request):
pictorial_ids = json.loads(request.POST.get('pictorial_ids', '[]'))
tag_id = int(request.POST.get('tag_id')) if request.POST.get('tag_id') else None
try:
self.rpc['venus/sun/pictorial/rm_tag'](pictorial_ids=pictorial_ids, tag_id=tag_id).unwrap()
except Exception as e:
error_logger.error(u'操作失败%s' % (e))
raise
return {
'message': '添加成功'
}
......@@ -97,10 +97,11 @@ class TagTypeSearchView(APIView):
class PictorialSearchView(APIView):
def get(self, request):
name = request.GET.get('name')
tag_id = request.GET.get('tag_id')
offset, count = get_offset_count(request)
try:
data = self.rpc['venus/sun/pictorial/search'](name=name, offset=offset, count=count).unwrap()
data = self.rpc['venus/sun/pictorial/search'](name=name, tag_id=tag_id, offset=offset, count=count).unwrap()
except Exception as e:
raise e
......
......@@ -260,6 +260,19 @@ class SearchDefaultKeyword(APIView):
return data
class TagRelatePictorialInfo(APIView):
def get(self, request):
id_ = request.GET.get('id')
offset, count = get_offset_count(request)
try:
data = self.rpc['venus/sun/tag/relate_pictorial_info'](id_=id_, offset=offset, count=count).unwrap()
except Exception as e:
error_logger.error(u'获取画报列表失败%s', e)
raise
return data
class TagSetListView(APIView):
def get(self, request):
......
......@@ -108,6 +108,7 @@ urlpatterns = [
url(r'^tag/filter/delete$', TagFilterDelete.as_view()),
url(r'^tag/search_recommend_keyword$', TagSearchRecommendKeyword.as_view()),
url(r'^tag/search_default_keyword$', SearchDefaultKeyword.as_view()),
url(r'^tag/related_pictorial_info$', TagRelatePictorialInfo.as_view()),
# 标签类型相关
url(r'^tag/tagtype/list$', TagTypeListView.as_view()),
......@@ -165,6 +166,8 @@ urlpatterns = [
url(r'^pictorial/topic/list$', PictorialTopicList.as_view()),
url(r'^pictorial/follows/del$', PictorialFollowsDel.as_view()),
url(r'^pictorial/follows/add$', PictorialFollowsAdd.as_view()),
url(r'^pictorial/tag_add$', PictorialTagAdd.as_view()),
url(r'^pictorial/tag_rm$', PictorialTagRm.as_view()),
#运营位
url(r'^topic/home_recommend/list', TopicHomeRecommendList.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