Commit 5bda06c0 authored by 王浩's avatar 王浩

Merge branch 'haow/pin_crawl' into 'master'

add log in batch create topic

See merge request !59
parents 056fca26 f9e807a5
...@@ -7,6 +7,7 @@ from api.cache.cache import ins_cache ...@@ -7,6 +7,7 @@ from api.cache.cache import ins_cache
from libs.user import get_user_by_ids from libs.user import get_user_by_ids
from alpha_types.venus import ERROR as CODES from alpha_types.venus import ERROR as CODES
from alpha_types.venus import GRAP_PLATFORM from alpha_types.venus import GRAP_PLATFORM
from engine.logger import info_logger
topic_id_cache = "ins_account_cache" topic_id_cache = "ins_account_cache"
...@@ -27,6 +28,16 @@ class CreateTopicForBatch(BaseView): ...@@ -27,6 +28,16 @@ class CreateTopicForBatch(BaseView):
topic_list = json.loads(request.POST.get("topic_list", '[]')) topic_list = json.loads(request.POST.get("topic_list", '[]'))
pictorial_tag_ids = json.loads(request.POST.get("tag_ids", '[]')) 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: if not user_id:
return self.parameter_invalid_response() return self.parameter_invalid_response()
...@@ -108,12 +119,21 @@ class CreateTopicForBatch(BaseView): ...@@ -108,12 +119,21 @@ class CreateTopicForBatch(BaseView):
tags = tag_names 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( _tag_error, _tag_data = self.call_rpc(
"venus/community/tag/batch_create_tag_by_name", "venus/community/tag/batch_create_tag_by_name",
tags=tags, is_own=1 tags=tags, is_own=1
) )
if _tag_error: if _tag_error:
return self.error(_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) #_tag_data.update(location_tags)
# 更新发帖 # 更新发帖
...@@ -137,6 +157,10 @@ class CreateTopicForBatch(BaseView): ...@@ -137,6 +157,10 @@ class CreateTopicForBatch(BaseView):
for tag_name in tags if _tag_data.get(tag_name) 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( create_err, result = self.call_rpc(
"venus/community/topic/batch_create_for_inner", "venus/community/topic/batch_create_for_inner",
topic_list=topic_list topic_list=topic_list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment