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
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
sun
Commits
da3707a5
Commit
da3707a5
authored
Aug 08, 2019
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix code
parent
a395e744
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
pictorial.py
api/pictorial.py
+33
-0
urls.py
api/urls.py
+2
-0
No files found.
api/pictorial.py
View file @
da3707a5
...
...
@@ -163,3 +163,36 @@ class PictorialTopicList(APIView):
error_logger
.
error
(
u'获取信息失败
%
s'
%
(
e
))
raise
return
data
class
PictorialTopicSetRank
(
APIView
):
"""设置榜单中帖子的优先级"""
def
post
(
self
,
request
):
pictorial_id
=
request
.
POST
.
get
(
'pictorial_id'
)
topic_id
=
request
.
POST
.
get
(
'topic_id'
)
rank
=
request
.
POST
.
get
(
'rank'
)
try
:
self
.
rpc
[
'venus/sun/pictorial/topic/set_rank'
](
pictorial_id
=
pictorial_id
,
topic_id
=
topic_id
,
rank
=
rank
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败
%
s'
%
(
e
))
raise
return
{
'message'
:
'操作成功'
}
class
PictorialTopicDel
(
APIView
):
"""删除榜单中的帖子"""
def
post
(
self
,
request
):
pictorial_id
=
request
.
POST
.
get
(
'pictorial_id'
)
topic_id
=
request
.
POST
.
get
(
'topic_id'
)
try
:
self
.
rpc
[
'venus/sun/pictorial/topic/del'
](
pictorial_id
=
pictorial_id
,
topic_id
=
topic_id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败
%
s'
%
(
e
))
raise
return
{
'message'
:
'删除成功'
}
api/urls.py
View file @
da3707a5
...
...
@@ -141,6 +141,8 @@ urlpatterns = [
url
(
r'^suggestion/list$'
,
SuggestionListView
.
as_view
()),
# 画报相关
url
(
r'^pictorial/topic/set_rank$'
,
PictorialTopicSetRank
.
as_view
()),
url
(
r'^pictorial/topic/del$'
,
PictorialTopicDel
.
as_view
()),
url
(
r'^pictorial/list$'
,
PictorialListView
.
as_view
()),
url
(
r'^pictorial/list/update$'
,
PictorialListView
.
as_view
()),
url
(
r'^pictorial/get$'
,
PictorialUpdateOrCreate
.
as_view
()),
...
...
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