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
095c8c4c
Commit
095c8c4c
authored
Aug 08, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'test'
fix code See merge request
alpha/sun!296
parents
72acbb89
da3707a5
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 @
095c8c4c
...
...
@@ -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 @
095c8c4c
...
...
@@ -142,6 +142,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