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
11f4a480
Commit
11f4a480
authored
Oct 21, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/kyc' into 'test'
最后一题 See merge request
alpha/sun!378
parents
f3ff85be
28df81ef
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
pictorial.py
api/pictorial.py
+36
-0
search.py
api/search.py
+2
-1
urls.py
api/urls.py
+2
-0
No files found.
api/pictorial.py
View file @
11f4a480
...
...
@@ -231,3 +231,39 @@ class PictorialFollowsAdd(APIView):
return
{
'message'
:
'添加成功'
}
class
PictorialTagAdd
(
APIView
):
"""新增榜单tag"""
def
post
(
self
,
request
):
pictorial_ids
=
json
.
loads
(
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
))
tag_id
=
int
(
request
.
POST
.
get
(
'tag_id'
))
if
request
.
POST
.
get
(
'tag_id'
)
else
None
try
:
self
.
rpc
[
'venus/sun/pictorial/add_tag'
](
pictorial_ids
=
pictorial_ids
,
tag_id
=
tag_id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败
%
s'
%
(
e
))
raise
return
{
'message'
:
'添加成功'
}
class
PictorialTagRm
(
APIView
):
"""删除榜单tag"""
def
post
(
self
,
request
):
import
ipdb
ipdb
.
set_trace
()
pictorial_ids
=
json
.
loads
(
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
))
tag_id
=
int
(
request
.
POST
.
get
(
'tag_id'
))
if
request
.
POST
.
get
(
'tag_id'
)
else
None
try
:
self
.
rpc
[
'venus/sun/pictorial/rm_tag'
](
pictorial_ids
=
pictorial_ids
,
tag_id
=
tag_id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败
%
s'
%
(
e
))
raise
return
{
'message'
:
'添加成功'
}
api/search.py
View file @
11f4a480
...
...
@@ -97,10 +97,11 @@ class TagTypeSearchView(APIView):
class
PictorialSearchView
(
APIView
):
def
get
(
self
,
request
):
name
=
request
.
GET
.
get
(
'name'
)
tag_id
=
request
.
GET
.
get
(
'tag_id'
)
offset
,
count
=
get_offset_count
(
request
)
try
:
data
=
self
.
rpc
[
'venus/sun/pictorial/search'
](
name
=
name
,
offset
=
offset
,
count
=
count
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/pictorial/search'
](
name
=
name
,
tag_id
=
tag_id
,
offset
=
offset
,
count
=
count
)
.
unwrap
()
except
Exception
as
e
:
raise
e
...
...
api/urls.py
View file @
11f4a480
...
...
@@ -165,6 +165,8 @@ urlpatterns = [
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'^pictorial/tag_add$'
,
PictorialTagAdd
.
as_view
()),
url
(
r'^pictorial/tag_rm$'
,
PictorialTagRm
.
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