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
0f0cc071
Commit
0f0cc071
authored
May 10, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'dev'
fix code about api See merge request
alpha/sun!203
parents
af62df78
11ef5e7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
22 deletions
+25
-22
beauty.py
api/beauty.py
+7
-7
urls.py
api/urls.py
+15
-12
word_parent.py
api/word_parent.py
+3
-3
No files found.
api/beauty.py
View file @
0f0cc071
...
...
@@ -7,10 +7,10 @@ class BeautyListView(APIView):
def
get
(
self
,
request
):
offset
,
count
=
get_offset_count
(
request
)
parent_word_id
=
request
.
GET
.
get
(
'parent_word
_id'
,
None
)
word_parent_id
=
request
.
GET
.
get
(
'word_parent
_id'
,
None
)
is_online
=
request
.
GET
.
get
(
'is_online'
,
None
)
data
=
self
.
rpc
[
'venus/sun/beauty/list'
](
offset
=
offset
,
count
=
count
,
parent_word_id
=
parent_word
_id
,
is_online
=
is_online
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/beauty/list'
](
offset
=
offset
,
count
=
count
,
word_parent_id
=
word_parent
_id
,
is_online
=
is_online
)
.
unwrap
()
return
data
...
...
@@ -18,12 +18,12 @@ class BeautyCreateView(APIView):
def
post
(
self
,
request
):
url
=
request
.
POST
.
get
(
'url'
,
None
)
parent_word_id
=
request
.
POST
.
get
(
'parent_word
_id'
,
None
)
word_parent_id
=
request
.
POST
.
get
(
'word_parent
_id'
,
None
)
if
not
url
or
not
parent_word
_id
:
if
not
url
or
not
word_parent
_id
:
return
r'缺少参数'
data
=
self
.
rpc
[
'venus/sun/beauty/add'
](
url
=
url
,
parent_word_id
=
parent_word
_id
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/beauty/add'
](
url
=
url
,
word_parent_id
=
word_parent
_id
)
.
unwrap
()
return
data
...
...
@@ -33,12 +33,12 @@ class BeautyUpdateView(APIView):
def
post
(
self
,
request
):
id_
=
request
.
POST
.
get
(
'id'
,
None
)
url
=
request
.
POST
.
get
(
'url'
,
None
)
parent_word_id
=
request
.
POST
.
get
(
'parent_word
_id'
,
None
)
word_parent_id
=
request
.
POST
.
get
(
'word_parent
_id'
,
None
)
if
not
id_
:
return
r'缺少参数'
data
=
self
.
rpc
[
'venus/sun/beauty/edit'
](
id_
=
id_
,
url
=
url
,
parent_word_id
=
parent_word
_id
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/beauty/edit'
](
id_
=
id_
,
url
=
url
,
word_parent_id
=
word_parent
_id
)
.
unwrap
()
if
not
data
:
return
r'更新失败'
...
...
api/urls.py
View file @
0f0cc071
...
...
@@ -23,6 +23,9 @@ from .commons import *
from
.pictorial
import
*
from
.operation
import
*
from
.tools
import
*
from
.beauty
import
*
from
.word_parent
import
*
from
.activity
import
*
urlpatterns
=
[
...
...
@@ -153,22 +156,22 @@ urlpatterns = [
url
(
r'^tools/batch_create_topic_with_ai_fashion_tag$'
,
BatchCreateTopicWithAiFashionTag
.
as_view
()),
# 母词
url
(
r'^word_parent/list$'
,
VirtualVote
.
as_view
()),
url
(
r'^word_parent/create$'
,
VirtualVote
.
as_view
()),
url
(
r'^word_parent/update$'
,
VirtualVote
.
as_view
()),
url
(
r'^word_parent/delete$'
,
VirtualVote
.
as_view
()),
url
(
r'^word_parent/list$'
,
WordParentListView
.
as_view
()),
url
(
r'^word_parent/create$'
,
WordParentCreateView
.
as_view
()),
url
(
r'^word_parent/update$'
,
WordParentUpdateView
.
as_view
()),
url
(
r'^word_parent/delete$'
,
WordParentDeleteView
.
as_view
()),
# 美图
url
(
r'^beauty/list$'
,
VirtualVote
.
as_view
()),
url
(
r'^beauty/create$'
,
VirtualVote
.
as_view
()),
url
(
r'^beauty/update$'
,
VirtualVote
.
as_view
()),
url
(
r'^beauty/delete$'
,
VirtualVote
.
as_view
()),
url
(
r'^beauty/list$'
,
BeautyListView
.
as_view
()),
url
(
r'^beauty/create$'
,
BeautyCreateView
.
as_view
()),
url
(
r'^beauty/update$'
,
BeautyUpdateView
.
as_view
()),
url
(
r'^beauty/delete$'
,
BeautyDeleteView
.
as_view
()),
# 活动
url
(
r'^activity/list$'
,
VirtualVote
.
as_view
()),
url
(
r'^activity/create$'
,
VirtualVote
.
as_view
()),
url
(
r'^activity/update$'
,
VirtualVote
.
as_view
()),
url
(
r'^activity/delete$'
,
VirtualVote
.
as_view
()),
url
(
r'^activity/list$'
,
ActivityListView
.
as_view
()),
url
(
r'^activity/create$'
,
ActivityCreateView
.
as_view
()),
url
(
r'^activity/update$'
,
ActivityUpdateView
.
as_view
()),
url
(
r'^activity/delete$'
,
ActivityDeleteView
.
as_view
()),
]
...
...
api/word_parent.py
View file @
0f0cc071
...
...
@@ -19,9 +19,9 @@ class WordParentCreateView(APIView):
def
post
(
self
,
request
):
name
=
request
.
POST
.
get
(
'name'
,
None
)
children_words
=
json
.
loads
(
request
.
POST
.
get
(
'children_words'
,
'[]'
))
content_ad
=
request
.
POST
.
get
(
'content_ad'
,
None
)
makeup_ad
=
request
.
POST
.
get
(
'makeup_ad'
,
None
)
dress_ad
=
request
.
POST
.
get
(
'dress_ad'
,
None
)
content_ad
=
request
.
POST
.
get
(
'content_ad'
,
''
)
makeup_ad
=
request
.
POST
.
get
(
'makeup_ad'
,
''
)
dress_ad
=
request
.
POST
.
get
(
'dress_ad'
,
''
)
if
not
name
:
return
r'缺少参数'
...
...
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