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
4fd50559
Commit
4fd50559
authored
May 13, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'dev'
change delete api to mul See merge request
alpha/sun!204
parents
0f0cc071
8c09f66e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
17 deletions
+52
-17
activity.py
api/activity.py
+16
-6
beauty.py
api/beauty.py
+17
-6
urls.py
api/urls.py
+3
-0
word_parent.py
api/word_parent.py
+16
-5
No files found.
api/activity.py
View file @
4fd50559
...
...
@@ -14,6 +14,15 @@ class ActivityListView(APIView):
return
data
class
ActivityInfoView
(
APIView
):
def
get
(
self
,
request
):
id_
=
request
.
GET
.
get
(
'id'
)
data
=
self
.
rpc
[
'venus/sun/activity/get'
](
id_
=
id_
)
.
unwrap
()
return
data
class
ActivityCreateView
(
APIView
):
def
post
(
self
,
request
):
...
...
@@ -53,13 +62,14 @@ class ActivityUpdateView(APIView):
class
ActivityDeleteView
(
APIView
):
def
post
(
self
,
request
):
id_
=
request
.
POST
.
get
(
'id'
,
None
)
if
not
id_
:
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
if
not
ids
:
return
r'缺少参数'
data
=
self
.
rpc
[
'venus/sun/activity/delete'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
for
id_
in
ids
:
data
=
self
.
rpc
[
'venus/sun/activity/delete'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
return
data
api/beauty.py
View file @
4fd50559
...
...
@@ -14,6 +14,15 @@ class BeautyListView(APIView):
return
data
class
BeautyInfoView
(
APIView
):
def
get
(
self
,
request
):
id_
=
request
.
GET
.
get
(
'id'
)
data
=
self
.
rpc
[
'venus/sun/beauty/get'
](
id_
=
id_
)
.
unwrap
()
return
data
class
BeautyCreateView
(
APIView
):
def
post
(
self
,
request
):
...
...
@@ -48,13 +57,15 @@ class BeautyUpdateView(APIView):
class
BeautyDeleteView
(
APIView
):
def
post
(
self
,
request
):
id
_
=
request
.
POST
.
get
(
'id'
,
None
)
if
not
id
_
:
id
s
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
)
)
if
not
id
s
:
return
r'缺少参数'
data
=
self
.
rpc
[
'venus/sun/beauty/delete'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
for
id_
in
ids
:
data
=
self
.
rpc
[
'venus/sun/beauty/delete'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
return
data
api/urls.py
View file @
4fd50559
...
...
@@ -157,18 +157,21 @@ urlpatterns = [
# 母词
url
(
r'^word_parent/list$'
,
WordParentListView
.
as_view
()),
url
(
r'^word_parent/get$'
,
WordParentInfoView
.
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$'
,
BeautyListView
.
as_view
()),
url
(
r'^beauty/get$'
,
BeautyInfoView
.
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$'
,
ActivityListView
.
as_view
()),
url
(
r'^activity/get$'
,
ActivityInfoView
.
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 @
4fd50559
...
...
@@ -14,6 +14,16 @@ class WordParentListView(APIView):
return
data
class
WordParentInfoView
(
APIView
):
def
get
(
self
,
request
):
id_
=
request
.
GET
.
get
(
'id'
)
data
=
self
.
rpc
[
'venus/sun/word_parent/get'
](
id_
=
id_
)
.
unwrap
()
return
data
class
WordParentCreateView
(
APIView
):
def
post
(
self
,
request
):
...
...
@@ -54,13 +64,14 @@ class WordParentUpdateView(APIView):
class
WordParentDeleteView
(
APIView
):
def
post
(
self
,
request
):
id
_
=
request
.
POST
.
get
(
'id'
,
None
)
id
s
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
)
)
if
not
id
_
:
if
not
id
s
:
return
r'缺少参数'
data
=
self
.
rpc
[
'venus/sun/word_parent/delete'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
for
id_
in
ids
:
data
=
self
.
rpc
[
'venus/sun/word_parent/delete'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
return
data
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