Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
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
钟尚武
saturn
Commits
84a581ee
Commit
84a581ee
authored
May 29, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/pin_crawl' into 'test'
add log in batch create topic See merge request
alpha/saturn!58
parents
02f63f7e
f9e807a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
topic.py
api/views/topic.py
+24
-0
No files found.
api/views/topic.py
View file @
84a581ee
...
...
@@ -7,6 +7,7 @@ from api.cache.cache import ins_cache
from
libs.user
import
get_user_by_ids
from
alpha_types.venus
import
ERROR
as
CODES
from
alpha_types.venus
import
GRAP_PLATFORM
from
engine.logger
import
info_logger
topic_id_cache
=
"ins_account_cache"
...
...
@@ -27,6 +28,16 @@ class CreateTopicForBatch(BaseView):
topic_list
=
json
.
loads
(
request
.
POST
.
get
(
"topic_list"
,
'[]'
))
pictorial_tag_ids
=
json
.
loads
(
request
.
POST
.
get
(
"tag_ids"
,
'[]'
))
info_logger
.
info
({
'user_id'
:
user_id
,
'card_level'
:
card_level
,
'tag_id'
:
tag_id
,
'is_online'
:
is_online
,
'platform'
:
platform
,
'topic_list'
:
topic_list
,
'pictorial_tag_ids'
:
pictorial_tag_ids
,
})
if
not
user_id
:
return
self
.
parameter_invalid_response
()
...
...
@@ -108,12 +119,21 @@ class CreateTopicForBatch(BaseView):
tags
=
tag_names
# 先创建标签
info_logger
.
info
({
'api'
:
'venus/community/tag/batch_create_tag_by_name'
,
'tags'
:
tags
,
'is_own'
:
1
,
})
_tag_error
,
_tag_data
=
self
.
call_rpc
(
"venus/community/tag/batch_create_tag_by_name"
,
tags
=
tags
,
is_own
=
1
)
if
_tag_error
:
return
self
.
error
(
_tag_error
)
info_logger
.
info
({
'api'
:
'venus/community/tag/batch_create_tag_by_name'
,
'_tag_data'
:
_tag_data
,
})
#_tag_data.update(location_tags)
# 更新发帖
...
...
@@ -137,6 +157,10 @@ class CreateTopicForBatch(BaseView):
for
tag_name
in
tags
if
_tag_data
.
get
(
tag_name
)
]
info_logger
.
info
({
'api'
:
'venus/community/topic/batch_create_for_inner'
,
'topic_list'
:
topic_list
,
})
create_err
,
result
=
self
.
call_rpc
(
"venus/community/topic/batch_create_for_inner"
,
topic_list
=
topic_list
...
...
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