Commit da3707a5 authored by haowang's avatar haowang

fix code

parent a395e744
......@@ -163,3 +163,36 @@ class PictorialTopicList(APIView):
error_logger.error(u'获取信息失败%s' % (e))
raise
return data
class PictorialTopicSetRank(APIView):
"""设置榜单中帖子的优先级"""
def post(self, request):
pictorial_id = request.POST.get('pictorial_id')
topic_id = request.POST.get('topic_id')
rank = request.POST.get('rank')
try:
self.rpc['venus/sun/pictorial/topic/set_rank'](pictorial_id=pictorial_id, topic_id=topic_id, rank=rank).unwrap()
except Exception as e:
error_logger.error(u'操作失败%s' % (e))
raise
return {
'message': '操作成功'
}
class PictorialTopicDel(APIView):
"""删除榜单中的帖子"""
def post(self, request):
pictorial_id = request.POST.get('pictorial_id')
topic_id = request.POST.get('topic_id')
try:
self.rpc['venus/sun/pictorial/topic/del'](pictorial_id=pictorial_id, topic_id=topic_id).unwrap()
except Exception as e:
error_logger.error(u'操作失败%s' % (e))
raise
return {
'message': '删除成功'
}
......@@ -141,6 +141,8 @@ urlpatterns = [
url(r'^suggestion/list$', SuggestionListView.as_view()),
# 画报相关
url(r'^pictorial/topic/set_rank$', PictorialTopicSetRank.as_view()),
url(r'^pictorial/topic/del$', PictorialTopicDel.as_view()),
url(r'^pictorial/list$', PictorialListView.as_view()),
url(r'^pictorial/list/update$', PictorialListView.as_view()),
url(r'^pictorial/get$', PictorialUpdateOrCreate.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