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
1ead0077
Commit
1ead0077
authored
Jun 13, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Alpha 1.9 See merge request
alpha/sun!214
parents
0f8e4475
8c60946d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
2 deletions
+67
-2
operation.py
api/operation.py
+20
-0
tag.py
api/tag.py
+44
-2
urls.py
api/urls.py
+3
-0
No files found.
api/operation.py
View file @
1ead0077
...
@@ -188,3 +188,23 @@ class OperationList(APIView):
...
@@ -188,3 +188,23 @@ class OperationList(APIView):
raise
raise
return
data
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 @
1ead0077
...
@@ -137,9 +137,10 @@ class TagRegisterUpdateView(APIView):
...
@@ -137,9 +137,10 @@ class TagRegisterUpdateView(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'tag_ids'
)
male_ids
=
request
.
POST
.
get
(
'male_ids'
)
female_ids
=
request
.
POST
.
get
(
'female_ids'
)
try
:
try
:
self
.
rpc
[
'venus/sun/tag/register_tag/update'
](
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/tag/register_tag/update'
](
female_ids
=
female_ids
,
male_ids
=
male_
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'配置失败'
)
error_logger
.
error
(
u'配置失败'
)
raise
raise
...
@@ -198,3 +199,44 @@ class TagFilterDelete(APIView):
...
@@ -198,3 +199,44 @@ class TagFilterDelete(APIView):
return
{
'message'
:
'操作失败'
}
return
{
'message'
:
'操作失败'
}
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'
,
''
)
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'
,
''
)
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 @
1ead0077
...
@@ -94,6 +94,8 @@ urlpatterns = [
...
@@ -94,6 +94,8 @@ urlpatterns = [
url
(
r'^tag/filter/list$'
,
TagFilterList
.
as_view
()),
url
(
r'^tag/filter/list$'
,
TagFilterList
.
as_view
()),
url
(
r'^tag/filter/add$'
,
TagFilterCreate
.
as_view
()),
url
(
r'^tag/filter/add$'
,
TagFilterCreate
.
as_view
()),
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_default_keyword$'
,
SearchDefaultKeyword
.
as_view
()),
# 标签类型相关
# 标签类型相关
url
(
r'^tag/tagtype/list$'
,
TagTypeListView
.
as_view
()),
url
(
r'^tag/tagtype/list$'
,
TagTypeListView
.
as_view
()),
...
@@ -149,6 +151,7 @@ urlpatterns = [
...
@@ -149,6 +151,7 @@ urlpatterns = [
url
(
r'^operation/edit'
,
OperationEdit
.
as_view
()),
url
(
r'^operation/edit'
,
OperationEdit
.
as_view
()),
url
(
r'^operation/list'
,
OperationList
.
as_view
()),
url
(
r'^operation/list'
,
OperationList
.
as_view
()),
url
(
r'^operation/delete'
,
OperationDelete
.
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
()),
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