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
7898b27a
Commit
7898b27a
authored
Sep 11, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/fix_pictorial' into 'test'
Ycl/fix pictorial See merge request
alpha/sun!349
parents
78aa261a
d4ca9517
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
pictorial.py
api/pictorial.py
+32
-2
urls.py
api/urls.py
+2
-0
No files found.
api/pictorial.py
View file @
7898b27a
...
...
@@ -48,7 +48,6 @@ class PictorialUpdateOrCreate(APIView):
id
=
int
(
request
.
POST
.
get
(
'id'
))
if
request
.
POST
.
get
(
'id'
)
else
None
star_ids
=
json
.
loads
(
request
.
POST
.
get
(
'star'
,
'[]'
))
pictorial_user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'pictorial_user_ids'
,
'[]'
))
collection_tag_ids
=
json
.
loads
(
request
.
POST
.
get
(
'collection_tag_ids'
,
'[]'
))
pictorial_activity_id
=
request
.
POST
.
get
(
'pictorial_activity_id'
)
tab_config
=
request
.
POST
.
get
(
"tab_config"
,
"[]"
)
...
...
@@ -59,7 +58,6 @@ class PictorialUpdateOrCreate(APIView):
'celebrity_ids'
:
star_ids
,
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
,
1
)),
'is_recommend'
:
int
(
request
.
POST
.
get
(
'is_recommend'
,
0
)),
'pictorial_user_ids'
:
pictorial_user_ids
,
'icon'
:
request
.
POST
.
get
(
'icon'
,
''
),
'collection_tag_ids'
:
collection_tag_ids
,
'is_home_recommend'
:
int
(
request
.
POST
.
get
(
'is_home_recommend'
,
0
)),
...
...
@@ -199,3 +197,35 @@ class PictorialTopicDel(APIView):
return
{
'message'
:
'删除成功'
}
class
PictorialFollowsDel
(
APIView
):
"""删除榜单中的关注者"""
def
post
(
self
,
request
):
pictorial_id
=
request
.
POST
.
get
(
'pictorial_id'
)
user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'user_ids'
,
'[]'
))
try
:
self
.
rpc
[
'venus/sun/pictorial/follows/del'
](
pictorial_id
=
pictorial_id
,
user_ids
=
user_ids
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败
%
s'
%
(
e
))
raise
return
{
'message'
:
'删除成功'
}
class
PictorialFollowsAdd
(
APIView
):
"""新增榜单中的关注者"""
def
post
(
self
,
request
):
pictorial_id
=
request
.
POST
.
get
(
'pictorial_id'
)
user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'user_ids'
,
'[]'
))
try
:
self
.
rpc
[
'venus/sun/pictorial/follows/add'
](
pictorial_id
=
pictorial_id
,
user_ids
=
user_ids
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败
%
s'
%
(
e
))
raise
return
{
'message'
:
'添加成功'
}
api/urls.py
View file @
7898b27a
...
...
@@ -161,6 +161,8 @@ urlpatterns = [
url
(
r'^pictorial/feed/rank$'
,
PictorialFeedlRank
.
as_view
()),
url
(
r'^pictorial/feed/delete$'
,
PictorialFeedDelete
.
as_view
()),
url
(
r'^pictorial/topic/list$'
,
PictorialTopicList
.
as_view
()),
url
(
r'^pictorial/follows/del$'
,
PictorialFollowsDel
.
as_view
()),
url
(
r'^pictorial/follows/add$'
,
PictorialFollowsAdd
.
as_view
()),
#运营位
url
(
r'^topic/home_recommend/list'
,
TopicHomeRecommendList
.
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