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
fd10f78f
Commit
fd10f78f
authored
Sep 29, 2019
by
yangchenglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt_topic
parent
fee2da8a
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 @
fd10f78f
...
@@ -161,7 +161,6 @@ class TopicUpdateOrCreateView(APIView):
...
@@ -161,7 +161,6 @@ class TopicUpdateOrCreateView(APIView):
'is_recommend'
:
int
(
request
.
POST
.
get
(
'is_recommend'
,
0
)),
'is_recommend'
:
int
(
request
.
POST
.
get
(
'is_recommend'
,
0
)),
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
'product_id'
:
request
.
POST
.
get
(
'product_id'
),
'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
)),
'have_face'
:
int
(
request
.
POST
.
get
(
'have_face'
,
0
)),
'is_finished'
:
int
(
request
.
POST
.
get
(
'is_finished'
,
1
)),
'is_finished'
:
int
(
request
.
POST
.
get
(
'is_finished'
,
1
)),
}
}
...
@@ -219,7 +218,7 @@ class TopicBallot(APIView):
...
@@ -219,7 +218,7 @@ class TopicBallot(APIView):
return
{
return
{
"message"
:
"更新成功"
"message"
:
"更新成功"
}
}
class
TopicProductAdd
(
APIView
):
class
TopicProductAdd
(
APIView
):
"""帖子添加商品关系"""
"""帖子添加商品关系"""
...
@@ -253,3 +252,21 @@ class TopicProductDel(APIView):
...
@@ -253,3 +252,21 @@ class TopicProductDel(APIView):
return
{
return
{
'message'
:
'更新成功'
'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 @
fd10f78f
...
@@ -66,6 +66,7 @@ urlpatterns = [
...
@@ -66,6 +66,7 @@ urlpatterns = [
url
(
r'^topic/ballot$'
,
TopicBallot
.
as_view
()),
url
(
r'^topic/ballot$'
,
TopicBallot
.
as_view
()),
url
(
r'^topic/product/add$'
,
TopicProductAdd
.
as_view
()),
url
(
r'^topic/product/add$'
,
TopicProductAdd
.
as_view
()),
url
(
r'^topic/product/del$'
,
TopicProductDel
.
as_view
()),
url
(
r'^topic/product/del$'
,
TopicProductDel
.
as_view
()),
url
(
r'^topic/ballot_batch$'
,
TopicBallotBatch
.
as_view
()),
# star相关
# star相关
url
(
r'^celebrity/list$'
,
CelebrityListView
.
as_view
()),
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