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
33ef6c13
Commit
33ef6c13
authored
Oct 21, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/kyc' into 'master'
Ycl/kyc See merge request
alpha/sun!384
parents
138553b7
e43fb4a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
1 deletion
+52
-1
pictorial.py
api/pictorial.py
+34
-0
search.py
api/search.py
+2
-1
tag.py
api/tag.py
+13
-0
urls.py
api/urls.py
+3
-0
No files found.
api/pictorial.py
View file @
33ef6c13
...
@@ -231,3 +231,37 @@ class PictorialFollowsAdd(APIView):
...
@@ -231,3 +231,37 @@ 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
):
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 @
33ef6c13
...
@@ -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
...
...
api/tag.py
View file @
33ef6c13
...
@@ -260,6 +260,19 @@ class SearchDefaultKeyword(APIView):
...
@@ -260,6 +260,19 @@ class SearchDefaultKeyword(APIView):
return
data
return
data
class
TagRelatePictorialInfo
(
APIView
):
def
get
(
self
,
request
):
id_
=
request
.
GET
.
get
(
'id'
)
offset
,
count
=
get_offset_count
(
request
)
try
:
data
=
self
.
rpc
[
'venus/sun/tag/relate_pictorial_info'
](
id_
=
id_
,
offset
=
offset
,
count
=
count
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取画报列表失败
%
s'
,
e
)
raise
return
data
class
TagSetListView
(
APIView
):
class
TagSetListView
(
APIView
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
...
...
api/urls.py
View file @
33ef6c13
...
@@ -108,6 +108,7 @@ urlpatterns = [
...
@@ -108,6 +108,7 @@ urlpatterns = [
url
(
r'^tag/filter/delete$'
,
TagFilterDelete
.
as_view
()),
url
(
r'^tag/filter/delete$'
,
TagFilterDelete
.
as_view
()),
url
(
r'^tag/search_recommend_keyword$'
,
TagSearchRecommendKeyword
.
as_view
()),
url
(
r'^tag/search_recommend_keyword$'
,
TagSearchRecommendKeyword
.
as_view
()),
url
(
r'^tag/search_default_keyword$'
,
SearchDefaultKeyword
.
as_view
()),
url
(
r'^tag/search_default_keyword$'
,
SearchDefaultKeyword
.
as_view
()),
url
(
r'^tag/related_pictorial_info$'
,
TagRelatePictorialInfo
.
as_view
()),
# 标签类型相关
# 标签类型相关
url
(
r'^tag/tagtype/list$'
,
TagTypeListView
.
as_view
()),
url
(
r'^tag/tagtype/list$'
,
TagTypeListView
.
as_view
()),
...
@@ -165,6 +166,8 @@ urlpatterns = [
...
@@ -165,6 +166,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
()),
...
...
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