Commit fd10f78f authored by yangchenglin's avatar yangchenglin

opt_topic

parent fee2da8a
......@@ -161,7 +161,6 @@ class TopicUpdateOrCreateView(APIView):
'is_recommend': int(request.POST.get('is_recommend', 0)),
'body_esthetics_tag_ids': body_esthetics_tag_ids,
'product_id': request.POST.get('product_id'),
'product_recommend': int(request.POST.get('product_recommend', 0)),
'have_face': int(request.POST.get('have_face', 0)),
'is_finished': int(request.POST.get('is_finished', 1)),
}
......@@ -219,7 +218,7 @@ class TopicBallot(APIView):
return {
"message": "更新成功"
}
class TopicProductAdd(APIView):
"""帖子添加商品关系"""
......@@ -253,3 +252,21 @@ class TopicProductDel(APIView):
return {
'message': '更新成功'
}
class TopicBallotBatch(APIView):
"""帖子批量投票"""
def post(self, request):
ids = json.loads(request.POST.get('ids', '[]'))
ballot_num = int(request.POST.get('ballot_num', 0))
try:
self.rpc['venus/sun/topic/ballot_batch'](ids=ids, ballot_num=ballot_num).unwrap()
except Exception as e:
error_logger.error(u'编辑%s帖子信息失败%s' % (ids, e))
raise
return {
'message': '更新成功'
}
......@@ -66,6 +66,7 @@ urlpatterns = [
url(r'^topic/ballot$', TopicBallot.as_view()),
url(r'^topic/product/add$', TopicProductAdd.as_view()),
url(r'^topic/product/del$', TopicProductDel.as_view()),
url(r'^topic/ballot_batch$', TopicBallotBatch.as_view()),
# star相关
url(r'^celebrity/list$', CelebrityListView.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