Commit b939f522 authored by haowang's avatar haowang

add create reply api

parent 3907b3f8
...@@ -4,6 +4,8 @@ from django.conf.urls import url ...@@ -4,6 +4,8 @@ from django.conf.urls import url
from .views import user from .views import user
from .views import topic from .views import topic
from .views import tag from .views import tag
from .views import reply
urlpatterns = [ urlpatterns = [
# grasp # grasp
...@@ -22,4 +24,7 @@ urlpatterns = [ ...@@ -22,4 +24,7 @@ urlpatterns = [
url(r'^v1/validate_3party_account$', user.Validate3PartyAccount.as_view(), name='validate_3party_account$'), url(r'^v1/validate_3party_account$', user.Validate3PartyAccount.as_view(), name='validate_3party_account$'),
url(r'^v1/user/batch_create_shadow_user$', user.BatchCreateShadowUser.as_view(), name='batch_create_shadow_user$'), url(r'^v1/user/batch_create_shadow_user$', user.BatchCreateShadowUser.as_view(), name='batch_create_shadow_user$'),
url(r'^v1/user/batch_update_user_level_fans$', user.BatchUpdateUserLevelFansNum.as_view(), name='batch_update_user_level_fans$'), url(r'^v1/user/batch_update_user_level_fans$', user.BatchUpdateUserLevelFansNum.as_view(), name='batch_update_user_level_fans$'),
# reply
url(r'^v1/reply/create_for_inner$', reply.CreateReplyForInner.as_view(), name='create_reply_for_inner'),
] ]
import json
from api.views.base_view import BaseView
class CreateReplyForInner(BaseView):
"""
内部使用,创建评论回复
"""
def post(self, request):
user_id = request.POST.get('user_id')
topic_id = request.POST.get('topic_id')
content = request.POST.get('content', '')
replied_id = request.POST.get('replied_id')
error, data = self.call_rpc('venus/community/reply/for_inner_create', user_id=user_id, topic_id=topic_id, content=content, replied_id=replied_id)
if error:
return self.error(error)
return self.ok(data=data)
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