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
f8d82fbc
Commit
f8d82fbc
authored
Apr 01, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'dev'
add pictorial operation api See merge request
!160
parents
75757ca7
7ef94b51
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
operation.py
api/operation.py
+36
-0
urls.py
api/urls.py
+2
-0
No files found.
api/operation.py
View file @
f8d82fbc
...
@@ -79,3 +79,39 @@ class TopicHomeFixOperation(APIView):
...
@@ -79,3 +79,39 @@ class TopicHomeFixOperation(APIView):
return
{
return
{
'message'
:
'更新成功'
'message'
:
'更新成功'
}
}
class
PictorialHomeRecommendList
(
APIView
):
"""获取画报首页运营位推荐画报列表"""
def
get
(
self
,
request
):
offset
,
count
=
get_offset_count
(
request
)
filters
=
request
.
GET
.
get
(
'filters'
,
'{}'
)
sort_by
=
request
.
GET
.
get
(
'sort_by'
,
None
)
try
:
data
=
self
.
rpc
[
'venus/sun/operation/recommend/pictorial/list'
](
filters
=
filters
,
sort_by
=
sort_by
,
offset
=
offset
,
count
=
count
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取数据失败'
,
e
)
raise
return
data
class
PictorialHomeRecommendUpdate
(
APIView
):
"""更新画报首页运营位推荐画报"""
def
post
(
self
,
request
):
pictorial_id
=
request
.
POST
.
get
(
'id'
)
rank
=
request
.
POST
.
get
(
'rank'
)
try
:
if
pictorial_id
:
data
=
self
.
rpc
[
'venus/sun/operation/recommend/pictorial/delete'
](
pictorial_id
=
pictorial_id
)
.
unwrap
()
elif
rank
:
data
=
self
.
rpc
[
'venus/sun/operation/recommend/pictorial/rank'
](
rank
=
rank
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败'
,
e
)
raise
return
data
api/urls.py
View file @
f8d82fbc
...
@@ -137,6 +137,8 @@ urlpatterns = [
...
@@ -137,6 +137,8 @@ urlpatterns = [
url
(
r'^topic/home_recommend/list'
,
TopicHomeRecommendList
.
as_view
()),
url
(
r'^topic/home_recommend/list'
,
TopicHomeRecommendList
.
as_view
()),
url
(
r'^topic/home_recommend/edit'
,
TopicHomeRecommendEdit
.
as_view
()),
url
(
r'^topic/home_recommend/edit'
,
TopicHomeRecommendEdit
.
as_view
()),
url
(
r'^operation/home_fix'
,
TopicHomeFixOperation
.
as_view
()),
url
(
r'^operation/home_fix'
,
TopicHomeFixOperation
.
as_view
()),
url
(
r'^pictorial/home/recommend/list'
,
PictorialHomeRecommendList
.
as_view
()),
url
(
r'^pictorial/home/recommend/update'
,
PictorialHomeRecommendUpdate
.
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