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

Merge branch 'ycl/opt_topic' into 'test'

opt_topic

See merge request alpha/sun!365
parents df9b3762 fd10f78f
...@@ -162,7 +162,6 @@ class TopicUpdateOrCreateView(APIView): ...@@ -162,7 +162,6 @@ class TopicUpdateOrCreateView(APIView):
'is_recommend': int(request.POST.get('is_recommend', 0)), 'is_recommend': int(request.POST.get('is_recommend', 0)),
'body_esthetics_tag_ids': body_esthetics_tag_ids, 'body_esthetics_tag_ids': body_esthetics_tag_ids,
'product_id': request.POST.get('product_id'), '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)), 'have_face': int(request.POST.get('have_face', 0)),
'is_finished': int(request.POST.get('is_finished', 1)), 'is_finished': int(request.POST.get('is_finished', 1)),
} }
...@@ -220,7 +219,7 @@ class TopicBallot(APIView): ...@@ -220,7 +219,7 @@ class TopicBallot(APIView):
return { return {
"message": "更新成功" "message": "更新成功"
} }
class TopicProductAdd(APIView): class TopicProductAdd(APIView):
"""帖子添加商品关系""" """帖子添加商品关系"""
...@@ -254,3 +253,21 @@ class TopicProductDel(APIView): ...@@ -254,3 +253,21 @@ class TopicProductDel(APIView):
return { return {
'message': '更新成功' '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 = [ ...@@ -66,6 +66,7 @@ urlpatterns = [
url(r'^topic/ballot$', TopicBallot.as_view()), url(r'^topic/ballot$', TopicBallot.as_view()),
url(r'^topic/product/add$', TopicProductAdd.as_view()), url(r'^topic/product/add$', TopicProductAdd.as_view()),
url(r'^topic/product/del$', TopicProductDel.as_view()), url(r'^topic/product/del$', TopicProductDel.as_view()),
url(r'^topic/ballot_batch$', TopicBallotBatch.as_view()),
# star相关 # star相关
url(r'^celebrity/list$', CelebrityListView.as_view()), 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