Commit d4cbfc27 authored by 杨成林's avatar 杨成林

Merge branch 'ycl/pictorial2.0' into 'test'

Ycl/pictorial2.0

See merge request !215
parents 8c60946d b413ac0a
......@@ -61,7 +61,8 @@ class PictorialUpdateOrCreate(APIView):
'collection_tag_ids': collection_tag_ids,
'is_home_recommend': int(request.POST.get('is_home_recommend', 0)),
'add_score': int(request.POST.get('add_score', 0)),
'is_public': True if request.POST.get('is_public') == "true" else False
'is_public': True if request.POST.get('is_public') == "true" else False,
'is_feed': int(request.POST.get('is_feed',0))
}
try:
......@@ -94,3 +95,51 @@ class PictorialTopics(APIView):
return {
'message': '更新成功'
}
class PictorialFeedlListView(APIView):
def get(self, request):
order_by = request.GET.get('order_by', "-id")
offset = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 10))
try:
data = self.rpc['venus/sun/pictorial/feed/list'](offset=(offset - 1) * limit, limit=limit,
order_by=order_by).unwrap()
except Exception as e:
error_logger.error(u'获取画报列表失败%s' , e)
raise
return data
class PictorialFeedlRank(APIView):
"""修改画报首页like流rank"""
def post(self, request):
id_ = request.POST.get('id')
rank = int(request.POST.get('rank'))
try:
self.rpc['venus/sun/pictorial/feed/rank'](id_=id_, rank=rank).unwrap()
except Exception as e:
error_logger.error(u'编辑%信息失败%s' % (e))
raise
return {
'message': '更新成功'
}
class PictorialFeedDelete(APIView):
"""删除画报首页like流"""
def post(self, request):
ids = json.loads(request.POST.get('ids', '[]'))
try:
self.rpc['venus/sun/pictorial/feed/delete'](ids=ids).unwrap()
except Exception as e:
error_logger.error(u'删除信息失败%s' % (e))
raise
return {
'message': '删除成功'
}
\ No newline at end of file
......@@ -40,7 +40,7 @@ class TopicListView(APIView):
try:
data = self.rpc['venus/sun/topic/list'](
topic_ids=topic_ids
topic_ids=topic_ids, pictorial_id=pictorial_id
).unwrap()
except Exception as e:
error_logger.error(u'获取帖子列表失败%s', e)
......@@ -227,3 +227,20 @@ class TopicRelatePictorialInfo(APIView):
error_logger.error(u'获取帖子画报列表失败%s', e)
raise
return {'data': data}
class TopicBallot(APIView):
def post(self, request):
id_ = request.POST.get('id')
pictorial_id = request.POST.get('pictorial_id')
ballot_num = request.POST.get('ballot_num')
try:
self.rpc['venus/sun/topic/ballot'](id_=id_, pictorial_id=pictorial_id, ballot_num=ballot_num).unwrap()
except Exception as e:
error_logger.error(u'批量更新帖子失败%s', e)
raise
return {
"message": "更新成功"
}
......@@ -58,6 +58,7 @@ urlpatterns = [
url(r'^topic/reply/batch_delete$', ReplyUpdateOrCreateView.as_view()),
url(r'^topic/reply/create$', ReplyCreate.as_view()),
url(r'^topic/related_pictorial_info$', TopicRelatePictorialInfo.as_view()),
url(r'^topic/ballot$', TopicBallot.as_view()),
# star相关
url(r'^celebrity/list$', CelebrityListView.as_view()),
......@@ -141,6 +142,10 @@ urlpatterns = [
url(r'^pictorial/create$', PictorialUpdateOrCreate.as_view()),
url(r'^pictorial/topics$', PictorialTopics.as_view()),
url(r'^pictorial/user/list$', PictorialUserList.as_view()),
url(r'^pictorial/feed/list$', PictorialFeedlListView.as_view()),
url(r'^pictorial/feed/rank$', PictorialFeedlRank.as_view()),
url(r'^pictorial/feed/delete$', PictorialFeedDelete.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