Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
saturn
Commits
b939f522
Commit
b939f522
authored
Apr 18, 2019
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add create reply api
parent
3907b3f8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
urls.py
api/urls.py
+5
-0
reply.py
api/views/reply.py
+22
-0
No files found.
api/urls.py
View file @
b939f522
...
...
@@ -4,6 +4,8 @@ from django.conf.urls import url
from
.views
import
user
from
.views
import
topic
from
.views
import
tag
from
.views
import
reply
urlpatterns
=
[
# grasp
...
...
@@ -22,4 +24,7 @@ urlpatterns = [
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_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'
),
]
api/views/reply.py
0 → 100644
View file @
b939f522
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment