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
11f4a480
Commit
11f4a480
authored
5 years ago
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/kyc' into 'test'
最后一题 See merge request
!378
parents
f3ff85be
28df81ef
master
deploy/like-prod
deploy/like-stage
deploy/like-test
dev
test
2 merge requests
!379
Test
,
!395
2.6跟版需求上线
Hide 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):
...
@@ -231,3 +231,39 @@ class PictorialFollowsAdd(APIView):
return
{
return
{
'message'
:
'添加成功'
'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'
:
'添加成功'
}
This diff is collapsed.
Click to expand it.
api/search.py
View file @
11f4a480
...
@@ -97,10 +97,11 @@ class TagTypeSearchView(APIView):
...
@@ -97,10 +97,11 @@ class TagTypeSearchView(APIView):
class
PictorialSearchView
(
APIView
):
class
PictorialSearchView
(
APIView
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
name
=
request
.
GET
.
get
(
'name'
)
name
=
request
.
GET
.
get
(
'name'
)
tag_id
=
request
.
GET
.
get
(
'tag_id'
)
offset
,
count
=
get_offset_count
(
request
)
offset
,
count
=
get_offset_count
(
request
)
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
...
...
This diff is collapsed.
Click to expand it.
api/urls.py
View file @
11f4a480
...
@@ -165,6 +165,8 @@ urlpatterns = [
...
@@ -165,6 +165,8 @@ urlpatterns = [
url
(
r'^pictorial/topic/list$'
,
PictorialTopicList
.
as_view
()),
url
(
r'^pictorial/topic/list$'
,
PictorialTopicList
.
as_view
()),
url
(
r'^pictorial/follows/del$'
,
PictorialFollowsDel
.
as_view
()),
url
(
r'^pictorial/follows/del$'
,
PictorialFollowsDel
.
as_view
()),
url
(
r'^pictorial/follows/add$'
,
PictorialFollowsAdd
.
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
()),
url
(
r'^topic/home_recommend/list'
,
TopicHomeRecommendList
.
as_view
()),
...
...
This diff is collapsed.
Click to expand it.
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