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
2b955c24
Commit
2b955c24
authored
Jul 12, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/pictorial_activity' into 'dev'
ycl/pictorial_activity See merge request
alpha/sun!236
parents
7932a59d
77bab0cc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
3 deletions
+74
-3
activity.py
api/activity.py
+64
-1
operation.py
api/operation.py
+3
-1
pictorial.py
api/pictorial.py
+4
-1
urls.py
api/urls.py
+3
-0
No files found.
api/activity.py
View file @
2b955c24
import
json
import
json
from
datetime
import
datetime
from
utils.base
import
APIView
,
get_offset_count
from
utils.base
import
APIView
,
get_offset_count
from
utils.logger
import
error_logger
class
ActivityListView
(
APIView
):
class
ActivityListView
(
APIView
):
...
@@ -74,3 +74,66 @@ class ActivityDeleteView(APIView):
...
@@ -74,3 +74,66 @@ class ActivityDeleteView(APIView):
return
r'操作失败'
return
r'操作失败'
return
data
return
data
class
PictorialActivityInfoView
(
APIView
):
def
get
(
self
,
request
):
id_
=
int
(
request
.
GET
.
get
(
'id'
))
data
=
self
.
rpc
[
'venus/sun/activity/pictrial/info'
](
id_
=
id_
)
.
unwrap
()
if
not
data
:
return
r'获取失败'
return
data
class
PictorialActivityView
(
APIView
):
def
get
(
self
,
request
):
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/list'
](
name
=
name
,
offset
=
(
page
-
1
)
*
count
,
count
=
count
)
.
unwrap
()
if
not
data
:
return
r'获取失败'
return
data
def
post
(
self
,
request
):
data
=
{
"id"
:
request
.
POST
.
get
(
'id'
),
"name"
:
request
.
POST
.
get
(
'name'
,
None
),
"start_time"
:
int
(
request
.
POST
.
get
(
'start_time'
))
/
1000
,
"end_time"
:
int
(
request
.
POST
.
get
(
'end_time'
))
/
1000
,
"version"
:
request
.
POST
.
get
(
'version'
,
'0.0.0'
),
"banner"
:
request
.
POST
.
get
(
'banner'
),
"description"
:
request
.
POST
.
get
(
'description'
),
"titles"
:
json
.
loads
(
request
.
POST
.
get
(
'titles'
,
'[]'
))
}
data
=
self
.
rpc
[
'venus/sun/activity/pictrial/edit'
](
data
=
data
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
return
data
class
PictorialActivityOlineView
(
APIView
):
def
post
(
self
,
request
):
id_
=
int
(
request
.
POST
.
get
(
'id'
))
is_online
=
int
(
request
.
POST
.
get
(
'is_online'
))
data
=
self
.
rpc
[
'venus/sun/activity/pictrial/online'
](
id_
=
id_
,
is_online
=
is_online
)
.
unwrap
()
if
not
data
:
return
r'操作失败'
return
data
api/operation.py
View file @
2b955c24
...
@@ -67,12 +67,14 @@ class TopicHomeFixOperation(APIView):
...
@@ -67,12 +67,14 @@ class TopicHomeFixOperation(APIView):
image
=
request
.
POST
.
get
(
'image'
)
image
=
request
.
POST
.
get
(
'image'
)
protocol
=
request
.
POST
.
get
(
"protocol"
)
protocol
=
request
.
POST
.
get
(
"protocol"
)
pos
=
request
.
POST
.
get
(
"pos"
,
4
)
pos
=
request
.
POST
.
get
(
"pos"
,
4
)
version
=
request
.
POST
.
get
(
"version"
,
4
)
if
not
image
or
not
protocol
:
if
not
image
or
not
protocol
:
return
{
'message'
:
'参数不全'
}
return
{
'message'
:
'参数不全'
}
try
:
try
:
self
.
rpc
[
'venus/sun/operation/home_fix/edit'
](
image
=
image
,
protocol
=
protocol
,
pos
=
pos
)
.
unwrap
()
self
.
rpc
[
'venus/sun/operation/home_fix/edit'
](
image
=
image
,
protocol
=
protocol
,
pos
=
pos
,
version
=
version
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'更新失败'
,
e
)
error_logger
.
error
(
u'更新失败'
,
e
)
raise
raise
...
...
api/pictorial.py
View file @
2b955c24
...
@@ -46,10 +46,12 @@ class PictorialUpdateOrCreate(APIView):
...
@@ -46,10 +46,12 @@ class PictorialUpdateOrCreate(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
)
id
=
request
.
POST
.
get
(
'id'
)
star_ids
=
json
.
loads
(
request
.
POST
.
get
(
'star'
,
'[]'
))
star_ids
=
json
.
loads
(
request
.
POST
.
get
(
'star'
,
'[]'
))
pictorial_user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'pictorial_user_ids'
,
'[]'
))
pictorial_user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'pictorial_user_ids'
,
'[]'
))
collection_tag_ids
=
json
.
loads
(
request
.
POST
.
get
(
'collection_tag_ids'
,
'[]'
))
collection_tag_ids
=
json
.
loads
(
request
.
POST
.
get
(
'collection_tag_ids'
,
'[]'
))
pictorial_activity_id
=
request
.
POST
.
get
(
'pictorial_activity_id'
)
data
=
{
data
=
{
'name'
:
request
.
POST
.
get
(
'name'
,
''
),
'name'
:
request
.
POST
.
get
(
'name'
,
''
),
'description'
:
request
.
POST
.
get
(
'description'
,
''
),
'description'
:
request
.
POST
.
get
(
'description'
,
''
),
...
@@ -63,7 +65,8 @@ class PictorialUpdateOrCreate(APIView):
...
@@ -63,7 +65,8 @@ class PictorialUpdateOrCreate(APIView):
'is_home_recommend'
:
int
(
request
.
POST
.
get
(
'is_home_recommend'
,
0
)),
'is_home_recommend'
:
int
(
request
.
POST
.
get
(
'is_home_recommend'
,
0
)),
'add_score'
:
int
(
request
.
POST
.
get
(
'add_score'
,
0
)),
'add_score'
:
int
(
request
.
POST
.
get
(
'add_score'
,
0
)),
'is_public'
:
True
if
request
.
POST
.
get
(
'is_public'
)
==
"true"
else
False
,
'is_public'
:
True
if
request
.
POST
.
get
(
'is_public'
)
==
"true"
else
False
,
'is_feed'
:
int
(
request
.
POST
.
get
(
'is_feed'
,
0
))
'is_feed'
:
int
(
request
.
POST
.
get
(
'is_feed'
,
0
)),
'pictorial_activity_ids'
:
[
int
(
pictorial_activity_id
)
if
pictorial_activity_id
else
None
]
}
}
try
:
try
:
...
...
api/urls.py
View file @
2b955c24
...
@@ -192,6 +192,9 @@ urlpatterns = [
...
@@ -192,6 +192,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/online'
,
PictorialActivityView
.
as_view
()),
# 品牌
# 品牌
url
(
r'^brand/list$'
,
BrandListView
.
as_view
()),
url
(
r'^brand/list$'
,
BrandListView
.
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