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
8d3b5758
Commit
8d3b5758
authored
Sep 11, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/fix_pictorial' into 'master'
Ycl/fix pictorial See merge request
alpha/sun!352
parents
ab384acb
5a62544c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
pictorial.py
api/pictorial.py
+34
-2
urls.py
api/urls.py
+2
-0
user.py
api/user.py
+1
-0
No files found.
api/pictorial.py
View file @
8d3b5758
...
...
@@ -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,37 @@ class PictorialTopicDel(APIView):
return
{
'message'
:
'删除成功'
}
class
PictorialFollowsDel
(
APIView
):
"""删除榜单中的关注者"""
def
post
(
self
,
request
):
pictorial_id
=
int
(
request
.
POST
.
get
(
'pictorial_id'
,
0
))
user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'user_ids'
,
'[]'
))
user_ids
=
[
int
(
item
)
for
item
in
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
=
int
(
request
.
POST
.
get
(
'pictorial_id'
,
0
))
user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'user_ids'
,
'[]'
))
user_ids
=
[
int
(
item
)
for
item
in
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 @
8d3b5758
...
...
@@ -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
()),
...
...
api/user.py
View file @
8d3b5758
...
...
@@ -89,6 +89,7 @@ class UserUpdateOrCreate(APIView):
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
'expert_tag_ids'
:
expert_tag_ids
,
'is_kol'
:
int
(
request
.
POST
.
get
(
'is_kol'
,
0
)),
'is_edit'
:
int
(
request
.
POST
.
get
(
'is_edit'
,
0
)),
}
try
:
...
...
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