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
1
Merge Requests
1
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
alpha
sun
Commits
4b42d77e
Commit
4b42d77e
authored
May 07, 2019
by
yangchenglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Operation
parent
266cb0b3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
operation.py
api/operation.py
+65
-0
urls.py
api/urls.py
+3
-0
No files found.
api/operation.py
View file @
4b42d77e
...
...
@@ -119,3 +119,68 @@ class PictorialHomeRecommendUpdate(APIView):
return
u'操作失败'
return
data
class
OperationDelete
(
APIView
):
"""删除运营位"""
def
post
(
self
,
request
):
operation_id
=
request
.
POST
.
get
(
'id'
)
try
:
data
=
self
.
rpc
[
'venus/sun/operation/delete'
](
id_
=
operation_id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败'
,
e
)
raise
if
not
data
:
return
u'操作失败'
return
data
class
OperationEdit
(
APIView
):
"""编辑运营位"""
def
post
(
self
,
request
):
operation_id
=
request
.
POST
.
get
(
'id'
)
operation_type
=
int
(
request
.
POST
.
get
(
'operation_type'
))
image_url
=
request
.
POST
.
get
(
'image_url'
)
url
=
request
.
POST
.
get
(
'url'
)
start_time
=
int
(
request
.
POST
.
get
(
'start_time'
))
end_time
=
int
(
request
.
POST
.
get
(
'end_time'
))
data
=
{
"operation_type"
:
operation_type
,
"image_url"
:
image_url
,
"url"
:
url
,
"start_time"
:
start_time
,
"end_time"
:
end_time
}
try
:
data
=
self
.
rpc
[
'venus/sun/operation/edit'
](
id_
=
operation_id
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'操作失败'
,
e
)
raise
if
not
data
:
return
u'操作失败'
return
data
class
OperationList
(
APIView
):
"""获取运营位列表"""
def
get
(
self
,
request
):
operation_type
=
request
.
GET
.
get
(
'operation_type'
)
try
:
data
=
self
.
rpc
[
'venus/sun/operation/list'
](
operation_type
=
operation_type
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取失败'
,
e
)
raise
return
data
api/urls.py
View file @
4b42d77e
...
...
@@ -140,6 +140,9 @@ urlpatterns = [
url
(
r'^operation/home_fix'
,
TopicHomeFixOperation
.
as_view
()),
url
(
r'^operation/pictorial/recommend/list'
,
PictorialHomeRecommendList
.
as_view
()),
url
(
r'^operation/pictorial/recommend/update'
,
PictorialHomeRecommendUpdate
.
as_view
()),
url
(
r'^operation/edit'
,
OperationEdit
.
as_view
()),
url
(
r'^operation/list'
,
OperationList
.
as_view
()),
url
(
r'^operation/delete'
,
OperationDelete
.
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