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
b4e23a6a
Commit
b4e23a6a
authored
Sep 29, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/opt_topic' into 'test'
opt_topic See merge request
alpha/sun!365
parents
df9b3762
fd10f78f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
topic.py
api/topic.py
+19
-2
urls.py
api/urls.py
+1
-0
No files found.
api/topic.py
View file @
b4e23a6a
...
...
@@ -162,7 +162,6 @@ class TopicUpdateOrCreateView(APIView):
'is_recommend'
:
int
(
request
.
POST
.
get
(
'is_recommend'
,
0
)),
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
'product_id'
:
request
.
POST
.
get
(
'product_id'
),
'product_recommend'
:
int
(
request
.
POST
.
get
(
'product_recommend'
,
0
)),
'have_face'
:
int
(
request
.
POST
.
get
(
'have_face'
,
0
)),
'is_finished'
:
int
(
request
.
POST
.
get
(
'is_finished'
,
1
)),
}
...
...
@@ -220,7 +219,7 @@ class TopicBallot(APIView):
return
{
"message"
:
"更新成功"
}
class
TopicProductAdd
(
APIView
):
"""帖子添加商品关系"""
...
...
@@ -254,3 +253,21 @@ class TopicProductDel(APIView):
return
{
'message'
:
'更新成功'
}
class
TopicBallotBatch
(
APIView
):
"""帖子批量投票"""
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
ballot_num
=
int
(
request
.
POST
.
get
(
'ballot_num'
,
0
))
try
:
self
.
rpc
[
'venus/sun/topic/ballot_batch'
](
ids
=
ids
,
ballot_num
=
ballot_num
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'编辑
%
s帖子信息失败
%
s'
%
(
ids
,
e
))
raise
return
{
'message'
:
'更新成功'
}
api/urls.py
View file @
b4e23a6a
...
...
@@ -66,6 +66,7 @@ urlpatterns = [
url
(
r'^topic/ballot$'
,
TopicBallot
.
as_view
()),
url
(
r'^topic/product/add$'
,
TopicProductAdd
.
as_view
()),
url
(
r'^topic/product/del$'
,
TopicProductDel
.
as_view
()),
url
(
r'^topic/ballot_batch$'
,
TopicBallotBatch
.
as_view
()),
# star相关
url
(
r'^celebrity/list$'
,
CelebrityListView
.
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