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
dd6ac928
Commit
dd6ac928
authored
Jul 15, 2019
by
yangchenglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add total
parent
133d6c9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
activity.py
api/activity.py
+10
-10
urls.py
api/urls.py
+2
-1
No files found.
api/activity.py
View file @
dd6ac928
...
@@ -76,28 +76,28 @@ class ActivityDeleteView(APIView):
...
@@ -76,28 +76,28 @@ class ActivityDeleteView(APIView):
return
data
return
data
class
PictorialActivity
Info
View
(
APIView
):
class
PictorialActivity
List
View
(
APIView
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
id_
=
int
(
request
.
GET
.
get
(
'id'
))
name
=
request
.
GET
.
get
(
'name'
)
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
))
count
=
int
(
request
.
GET
.
get
(
'count'
,
10
))
data
=
self
.
rpc
[
'venus/sun/activity/pictrial/
info'
](
id_
=
id_
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/activity/pictrial/
list'
](
name
=
name
,
offset
=
(
page
-
1
)
*
count
,
count
=
count
)
.
unwrap
()
if
not
data
:
if
not
data
:
return
r'获取失败'
return
r'获取失败'
return
data
.
get
(
"data"
)
return
data
class
PictorialActivityView
(
APIView
):
class
PictorialActivityView
(
APIView
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
name
=
request
.
GET
.
get
(
'name'
)
id_
=
int
(
request
.
GET
.
get
(
'id'
))
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
))
count
=
int
(
request
.
GET
.
get
(
'count'
,
10
))
data
=
self
.
rpc
[
'venus/sun/activity/pictrial/
list'
](
name
=
name
,
offset
=
(
page
-
1
)
*
count
,
count
=
count
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/activity/pictrial/
info'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
if
not
data
:
return
r'获取失败'
return
r'获取失败'
...
@@ -108,8 +108,8 @@ class PictorialActivityView(APIView):
...
@@ -108,8 +108,8 @@ class PictorialActivityView(APIView):
data
=
{
data
=
{
"id"
:
request
.
POST
.
get
(
'id'
),
"id"
:
request
.
POST
.
get
(
'id'
),
"name"
:
request
.
POST
.
get
(
'name'
,
None
),
"name"
:
request
.
POST
.
get
(
'name'
,
None
),
"start_time"
:
int
(
request
.
POST
.
get
(
'start_time'
))
/
1000
,
"start_time"
:
request
.
POST
.
get
(
'start_time'
)
,
"end_time"
:
int
(
request
.
POST
.
get
(
'end_time'
))
/
1000
,
"end_time"
:
request
.
POST
.
get
(
'end_time'
)
,
"version"
:
request
.
POST
.
get
(
'version'
,
'0.0.0'
),
"version"
:
request
.
POST
.
get
(
'version'
,
'0.0.0'
),
"banner"
:
request
.
POST
.
get
(
'banner'
),
"banner"
:
request
.
POST
.
get
(
'banner'
),
"description"
:
request
.
POST
.
get
(
'description'
),
"description"
:
request
.
POST
.
get
(
'description'
),
...
...
api/urls.py
View file @
dd6ac928
...
@@ -184,8 +184,9 @@ urlpatterns = [
...
@@ -184,8 +184,9 @@ urlpatterns = [
url
(
r'^activity/create$'
,
ActivityCreateView
.
as_view
()),
url
(
r'^activity/create$'
,
ActivityCreateView
.
as_view
()),
url
(
r'^activity/update$'
,
ActivityUpdateView
.
as_view
()),
url
(
r'^activity/update$'
,
ActivityUpdateView
.
as_view
()),
url
(
r'^activity/delete$'
,
ActivityDeleteView
.
as_view
()),
url
(
r'^activity/delete$'
,
ActivityDeleteView
.
as_view
()),
url
(
r'^activity/pictorial/get'
,
PictorialActivityInfoView
.
as_view
()),
url
(
r'^activity/pictorial'
,
PictorialActivityView
.
as_view
()),
url
(
r'^activity/pictorial'
,
PictorialActivityView
.
as_view
()),
url
(
r'^activity/pictorial'
,
PictorialActivityView
.
as_view
()),
url
(
r'^activity/pictorial/list'
,
PictorialActivityListView
.
as_view
()),
url
(
r'^activity/pictorial/online'
,
PictorialActivityView
.
as_view
()),
url
(
r'^activity/pictorial/online'
,
PictorialActivityView
.
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