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
42438bb4
Commit
42438bb4
authored
Aug 23, 2019
by
许俊鹏
Browse files
Options
Browse Files
Download
Plain Diff
处理冲突
parents
b0381018
e0438c35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
reply.py
api/reply.py
+9
-2
topic.py
api/topic.py
+3
-2
No files found.
api/reply.py
View file @
42438bb4
...
...
@@ -178,9 +178,16 @@ class ReplyManageBatchUpdate(APIView):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
is_online
=
request
.
POST
.
get
(
'is_online'
,
None
)
data
=
{
}
if
request
.
POST
.
get
(
'is_online'
)
is
not
None
:
data
[
'is_online'
]
=
True
if
int
(
request
.
POST
.
get
(
'is_online'
,
0
))
else
False
if
request
.
POST
.
get
(
'is_quality'
)
is
not
None
:
data
[
'is_quality'
]
=
True
if
int
(
request
.
POST
.
get
(
'is_quality'
,
0
))
else
False
try
:
rep
=
self
.
rpc
[
'venus/sun/reply/manage/batch/update'
](
ids
=
ids
,
is_online
=
is_online
)
.
unwrap
()
rep
=
self
.
rpc
[
'venus/sun/reply/manage/batch/update'
](
ids
=
ids
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'更新-reply信息失败
%
s'
%
(
e
))
raise
...
...
api/topic.py
View file @
42438bb4
...
...
@@ -28,6 +28,8 @@ class TopicListView(APIView):
filters
.
update
({
'drop_score'
:
int
(
drop_score
)})
elif
int
(
drop_score
)
==
1
:
filters
.
update
({
'drop_score__exclude'
:
int
(
drop_score
)})
if
filters
.
get
(
"is_finished"
)
is
not
None
:
filters
[
"is_finished"
]
=
True
if
filters
.
get
(
"is_finished"
)
else
False
res
=
self
.
rpc
[
'physical/search/business/topic'
](
offset
=
(
page
-
1
)
*
limit
,
...
...
@@ -121,7 +123,6 @@ class TopicUpdateOrCreateView(APIView):
topic_images
=
list
(
map
(
lambda
x
:
x
[:
-
2
],
json
.
loads
(
request
.
POST
.
get
(
'topic_images'
,
'[]'
))))
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
))))
collection_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'collection_tags'
,
'[]'
))))
cut_word_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'cut_word_tags'
,
'[]'
))))
body_esthetics_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'body_esthetics_tags'
,
'[]'
))))
pictorial_ids
=
list
(
json
.
loads
(
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
)))
...
...
@@ -137,7 +138,6 @@ class TopicUpdateOrCreateView(APIView):
'star_id'
:
request
.
POST
.
get
(
'star'
,
''
)
.
split
(
':'
)[
0
],
'tag_ids'
:
tag_ids
,
'collection_tag_ids'
:
collection_tag_ids
,
'cut_word_tag_ids'
:
cut_word_tag_ids
,
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
,
0
)),
'drop_score'
:
int
(
request
.
POST
.
get
(
'drop_score'
,
0
)),
'has_image'
:
1
if
topic_images
else
0
,
...
...
@@ -148,6 +148,7 @@ class TopicUpdateOrCreateView(APIView):
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
'product_id'
:
request
.
POST
.
get
(
'product_id'
),
'have_face'
:
int
(
request
.
POST
.
get
(
'have_face'
,
0
)),
'is_finished'
:
int
(
request
.
POST
.
get
(
'is_finished'
,
1
)),
}
try
:
self
.
rpc
[
'venus/sun/topic/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
...
...
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