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
8b810bfc
Commit
8b810bfc
authored
May 30, 2019
by
许俊鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xujunpeng/feature/1_9' into 'test'
1.9需求开发 See merge request
alpha/sun!212
parents
d40f1124
f0f72d57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
0 deletions
+69
-0
operation.py
api/operation.py
+20
-0
tag.py
api/tag.py
+46
-0
urls.py
api/urls.py
+3
-0
No files found.
api/operation.py
View file @
8b810bfc
...
...
@@ -188,3 +188,23 @@ class OperationList(APIView):
raise
return
data
class
OperationSearchKeyword
(
APIView
):
def
get
(
self
,
request
):
try
:
data
=
self
.
rpc
[
'venus/sun/operation/search_keyword/get'
]()
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取搜索热门词失败
%
s'
,
e
)
raise
return
data
def
post
(
self
,
request
):
update
=
json
.
loads
(
request
.
POST
.
get
(
'update'
))
try
:
data
=
self
.
rpc
[
'venus/sun/operation/search_keyword/edit'
](
data
=
update
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取搜索热门词失败
%
s'
,
e
)
raise
return
data
api/tag.py
View file @
8b810bfc
...
...
@@ -199,3 +199,49 @@ class TagFilterDelete(APIView):
return
{
'message'
:
'操作失败'
}
return
{
'message'
:
'操作成功'
}
class
TagSearchRecommendKeyword
(
APIView
):
def
get
(
self
,
request
):
try
:
data
=
self
.
rpc
[
'venus/sun/tag/recommend_keyword/get'
]()
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取搜索热门词失败
%
s'
,
e
)
raise
return
data
def
post
(
self
,
request
):
# 如果有id 走update 。 否则走创建
id
=
request
.
POST
.
get
(
'id'
,
None
)
update
=
request
.
POST
.
get
(
'update'
)
if
not
update
:
return
{
'message'
:
'参数不完整'
}
try
:
data
=
self
.
rpc
[
'venus/sun/tag/recommend_keyword/edit'
](
data
=
update
,
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取搜索热门词失败
%
s'
,
e
)
raise
return
data
class
SearchDefaultKeyword
(
APIView
):
def
get
(
self
,
request
):
try
:
data
=
self
.
rpc
[
'venus/sun/tag/search_default_keyword/get'
]()
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取搜索默认关键字失败
%
s'
,
e
)
raise
return
data
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
None
)
update
=
request
.
POST
.
get
(
'update'
)
if
not
update
:
return
{
'message'
:
'参数不完整'
}
try
:
data
=
self
.
rpc
[
'venus/sun/tag/search_default_keyword/edit'
](
data
=
update
,
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'更新搜索默认关键字失败
%
s'
,
e
)
raise
return
data
api/urls.py
View file @
8b810bfc
...
...
@@ -94,6 +94,8 @@ urlpatterns = [
url
(
r'^tag/filter/list$'
,
TagFilterList
.
as_view
()),
url
(
r'^tag/filter/add$'
,
TagFilterCreate
.
as_view
()),
url
(
r'^tag/filter/delete$'
,
TagFilterDelete
.
as_view
()),
url
(
r'^tag/search_recommend_keyword$'
,
TagSearchRecommendKeyword
.
as_view
()),
url
(
r'^tag/search_default_keyword$'
,
SearchDefaultKeyword
.
as_view
()),
# 标签类型相关
url
(
r'^tag/tagtype/list$'
,
TagTypeListView
.
as_view
()),
...
...
@@ -149,6 +151,7 @@ urlpatterns = [
url
(
r'^operation/edit'
,
OperationEdit
.
as_view
()),
url
(
r'^operation/list'
,
OperationList
.
as_view
()),
url
(
r'^operation/delete'
,
OperationDelete
.
as_view
()),
url
(
r'^operation/search_keyword$'
,
OperationSearchKeyword
.
as_view
()),
# 工具
url
(
r'^tools/virtual_vote$'
,
VirtualVote
.
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