Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
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
0
Merge Requests
0
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
钟尚武
sun
Commits
264b8bd2
Commit
264b8bd2
authored
Aug 06, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'test'
fix code See merge request
alpha/sun!286
parents
366981c5
0c6dda63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
reply.py
api/reply.py
+18
-3
urls.py
api/urls.py
+3
-4
No files found.
api/reply.py
View file @
264b8bd2
from
datetime
import
datetime
import
json
import
json
from
utils.base
import
APIView
from
utils.base
import
APIView
from
utils.logger
import
error_logger
from
utils.logger
import
error_logger
...
@@ -137,8 +138,7 @@ class ReplyManageListView(APIView):
...
@@ -137,8 +138,7 @@ class ReplyManageListView(APIView):
filters
[
'create_time__lte'
]
=
to_create_time
filters
[
'create_time__lte'
]
=
to_create_time
try
:
try
:
data
=
self
.
rpc
[
'venus/sun/reply/manage/list'
](
offset
=
(
page
-
1
)
*
limit
,
limit
=
limit
,
filters
=
filters
,
data
=
self
.
rpc
[
'venus/sun/reply/manage/list'
](
offset
=
(
page
-
1
)
*
limit
,
limit
=
limit
,
filters
=
filters
,
other_filters
=
other_filters
)
.
unwrap
()
other_filters
=
other_filters
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'获取reply列表失败
%
s'
,
e
)
error_logger
.
error
(
u'获取reply列表失败
%
s'
,
e
)
raise
raise
...
@@ -164,7 +164,7 @@ class ReplyManageCreateView(APIView):
...
@@ -164,7 +164,7 @@ class ReplyManageCreateView(APIView):
'type'
:
REPLY_TYPE
.
PUPPET_REPLY_ANS
,
'type'
:
REPLY_TYPE
.
PUPPET_REPLY_ANS
,
}
}
try
:
try
:
rep
=
self
.
rpc
[
'venus/sun/reply/manage/edit'
](
id_
=
id_
,
data
=
data
,
)
.
unwrap
()
rep
=
self
.
rpc
[
'venus/sun/reply/manage/edit'
](
id_
=
id_
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'创建/编辑
%
s-reply信息失败
%
s'
%
(
id
,
e
))
error_logger
.
error
(
u'创建/编辑
%
s-reply信息失败
%
s'
%
(
id
,
e
))
raise
raise
...
@@ -172,3 +172,18 @@ class ReplyManageCreateView(APIView):
...
@@ -172,3 +172,18 @@ class ReplyManageCreateView(APIView):
"message"
:
'更新成功'
,
"message"
:
'更新成功'
,
"id"
:
rep
[
'id'
]
"id"
:
rep
[
'id'
]
}
}
class
ReplyBatchUpdate
(
APIView
):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
is_online
=
request
.
POST
.
get
(
'is_online'
,
None
)
try
:
rep
=
self
.
rpc
[
'venus/sun/reply/manage/batch/update'
](
ids
=
ids
,
is_online
=
is_online
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'更新-reply信息失败
%
s'
%
(
e
))
raise
return
{
"message"
:
'更新成功'
,
}
api/urls.py
View file @
264b8bd2
...
@@ -221,10 +221,9 @@ urlpatterns = [
...
@@ -221,10 +221,9 @@ urlpatterns = [
url
(
r'^reply/vote$'
,
ReplyVote
.
as_view
()),
url
(
r'^reply/vote$'
,
ReplyVote
.
as_view
()),
# 评论管理
# 评论管理
url
(
r'^reply/manage/list$'
,
ReplyManageListView
.
as_view
()),
url
(
r'^reply/manage/list$'
,
ReplyListView
.
as_view
()),
url
(
r'^reply/manage/create$'
,
ReplyManageCreateView
.
as_view
()),
url
(
r'^reply/manage/create$'
,
ReplyCreateView
.
as_view
()),
url
(
r'^reply/manage/batch/update$'
,
ReplyBatchUpdate
.
as_view
()),
]
]
search_urlpatterns
=
[
search_urlpatterns
=
[
...
...
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