Commit e972be54 authored by 许俊鹏's avatar 许俊鹏

Merge branch 'xujunpeng/temporary/alpha1-2' into 'dev'

增加批量修改帖子信息

See merge request alpha/sun!44
parents 152ed482 c195ddac
......@@ -130,3 +130,17 @@ class TopicListBatchUpdate(APIView):
"message": "更新成功"
}
class TopicListBatchUpdate_new(APIView):
def post(self, request):
ids = request.POST.get('ids', '').split()
updates = self.handle_filter(request.POST.get('updates', "{}"))
try:
self.rpc['venus/sun/topic/batch/update'](updates=updates, ids=ids).unwrap()
except Exception as e:
error_logger.error(u'批量更新帖子失败%s', e)
raise
return {
"message": "更新成功"
}
......@@ -55,6 +55,7 @@ urlpatterns = [
url(r'^topic/reply/list$', ReplyUpdateOrCreateView.as_view()),
url(r'^topic/reply/batch_delete$', ReplyUpdateOrCreateView.as_view()),
url(r'^topic/reply/create$', ReplyCreate.as_view()),
url(r'^topic/batch_update_new$', TopicListBatchUpdate_new.as_view()), # TODO 后台优化临时需求, 1.2 上线后与topic/batch_update 整合到一起
# 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