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
077988b8
Commit
077988b8
authored
Feb 21, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'dev'
tag add collection alias See merge request
alpha/sun!67
parents
48d41d3b
b71ab3a3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
search.py
api/search.py
+2
-1
tag.py
api/tag.py
+4
-3
topic.py
api/topic.py
+3
-0
urls.py
api/urls.py
+1
-1
No files found.
api/search.py
View file @
077988b8
...
@@ -48,8 +48,9 @@ class TagSearchView(APIView):
...
@@ -48,8 +48,9 @@ class TagSearchView(APIView):
offset
,
count
=
get_offset_count
(
request
)
offset
,
count
=
get_offset_count
(
request
)
name
=
request
.
GET
.
get
(
'name'
)
name
=
request
.
GET
.
get
(
'name'
)
platform
=
request
.
GET
.
get
(
'platform'
)
platform
=
request
.
GET
.
get
(
'platform'
)
collection
=
request
.
GET
.
get
(
'collection'
)
try
:
try
:
data
=
self
.
rpc
[
'venus/sun/tag/search'
](
offset
=
offset
,
count
=
count
,
name
=
name
,
platform
=
platform
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/tag/search'
](
offset
=
offset
,
count
=
count
,
name
=
name
,
platform
=
platform
,
collection
=
collection
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
raise
e
raise
e
return
{
return
{
...
...
api/tag.py
View file @
077988b8
...
@@ -59,7 +59,9 @@ class TagUpdateOrCreateView(APIView):
...
@@ -59,7 +59,9 @@ class TagUpdateOrCreateView(APIView):
'up_tags'
:
up_tags
,
'up_tags'
:
up_tags
,
'tagtypes'
:
tagtypes
,
'tagtypes'
:
tagtypes
,
'icon_url'
:
request
.
POST
.
get
(
'icon_url'
,
''
)[:
-
2
],
'icon_url'
:
request
.
POST
.
get
(
'icon_url'
,
''
)[:
-
2
],
'platform'
:
request
.
POST
.
get
(
'platform'
)
'platform'
:
request
.
POST
.
get
(
'platform'
),
'collection'
:
request
.
POST
.
get
(
'collection'
),
'alias'
:
request
.
POST
.
get
(
'alias'
)
}
}
try
:
try
:
data
=
self
.
rpc
[
'venus/sun/tag/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/tag/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
...
@@ -119,4 +121,4 @@ class TagTypeUpdateOrCreateView(APIView):
...
@@ -119,4 +121,4 @@ class TagTypeUpdateOrCreateView(APIView):
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'创建/编辑标签类型
%
d信息失败
%
s'
%
(
id
,
e
))
error_logger
.
error
(
u'创建/编辑标签类型
%
d信息失败
%
s'
%
(
id
,
e
))
raise
raise
return
data
return
data
\ No newline at end of file
api/topic.py
View file @
077988b8
...
@@ -48,6 +48,9 @@ class TopicUpdateOrCreateView(APIView):
...
@@ -48,6 +48,9 @@ class TopicUpdateOrCreateView(APIView):
id
=
request
.
POST
.
get
(
'id'
,
''
)
id
=
request
.
POST
.
get
(
'id'
,
''
)
topic_images
=
list
(
map
(
lambda
x
:
x
[:
-
2
],
json
.
loads
(
request
.
POST
.
get
(
'topic_images'
,
[]))))
topic_images
=
list
(
map
(
lambda
x
:
x
[:
-
2
],
json
.
loads
(
request
.
POST
.
get
(
'topic_images'
,
[]))))
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
))))
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
))))
collection_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'collection_tags'
,
'[]'
))))
tag_ids
=
tag_ids
+
collection_tag_ids
data
=
{
data
=
{
'topic_images'
:
topic_images
,
'topic_images'
:
topic_images
,
'video_url'
:
request
.
POST
.
get
(
'video_url'
,
''
),
'video_url'
:
request
.
POST
.
get
(
'video_url'
,
''
),
...
...
api/urls.py
View file @
077988b8
...
@@ -97,6 +97,7 @@ urlpatterns = [
...
@@ -97,6 +97,7 @@ urlpatterns = [
url
(
r'^tag/tagtype/create$'
,
TagTypeUpdateOrCreateView
.
as_view
()),
url
(
r'^tag/tagtype/create$'
,
TagTypeUpdateOrCreateView
.
as_view
()),
url
(
r'^tag/tagtype/detail$'
,
TagTypeUpdateOrCreateView
.
as_view
()),
url
(
r'^tag/tagtype/detail$'
,
TagTypeUpdateOrCreateView
.
as_view
()),
# 扫脸相关
url
(
r'^face/star/create$'
,
FaceStarEdit
.
as_view
()),
url
(
r'^face/star/create$'
,
FaceStarEdit
.
as_view
()),
url
(
r'^face/star/list$'
,
StarListView
.
as_view
()),
url
(
r'^face/star/list$'
,
StarListView
.
as_view
()),
url
(
r'^face/star/list/update$'
,
StarListView
.
as_view
()),
url
(
r'^face/star/list/update$'
,
StarListView
.
as_view
()),
...
@@ -107,7 +108,6 @@ urlpatterns = [
...
@@ -107,7 +108,6 @@ urlpatterns = [
url
(
r'^face/part/list/update$'
,
FacePartListView
.
as_view
()),
url
(
r'^face/part/list/update$'
,
FacePartListView
.
as_view
()),
url
(
r'^face/part/type_list$'
,
FacePartTypeListView
.
as_view
()),
url
(
r'^face/part/type_list$'
,
FacePartTypeListView
.
as_view
()),
# 文案相关
# 文案相关
url
(
r'^advertise/edit'
,
AdvertiseCreateView
.
as_view
()),
url
(
r'^advertise/edit'
,
AdvertiseCreateView
.
as_view
()),
url
(
r'^advertise/list$'
,
AdvertiseListView
.
as_view
()),
url
(
r'^advertise/list$'
,
AdvertiseListView
.
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