|
@@ -18,6 +18,7 @@ class Record(object):
|
|
self.title = None
|
|
self.title = None
|
|
self.gh_id = None
|
|
self.gh_id = None
|
|
self.publish_flag = None
|
|
self.publish_flag = None
|
|
|
|
+ self.channel_content_id = None
|
|
self.params = params
|
|
self.params = params
|
|
self.mysql_client = mysql_client
|
|
self.mysql_client = mysql_client
|
|
self.article_match_video_table = config.article_match_video_table
|
|
self.article_match_video_table = config.article_match_video_table
|
|
@@ -37,6 +38,7 @@ class Record(object):
|
|
self.content_id = self.params['articleId']
|
|
self.content_id = self.params['articleId']
|
|
self.flow_pool_level = self.params['flowPoolLevelTag']
|
|
self.flow_pool_level = self.params['flowPoolLevelTag']
|
|
self.publish_flag = self.params.get('publishFlag', 1)
|
|
self.publish_flag = self.params.get('publishFlag', 1)
|
|
|
|
+ self.channel_content_id = self.params.get("channelContentId")
|
|
logging(
|
|
logging(
|
|
code="1001",
|
|
code="1001",
|
|
info="搜索视频内容接口请求成功, 参数校验成功",
|
|
info="搜索视频内容接口请求成功, 参数校验成功",
|
|
@@ -124,6 +126,25 @@ class Record(object):
|
|
trace_id=self.trace_id
|
|
trace_id=self.trace_id
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ async def input_channel_content_id(self):
|
|
|
|
+ """
|
|
|
|
+ 将content_id, channel_content_id 记录
|
|
|
|
+ """
|
|
|
|
+ insert_sql = f"""
|
|
|
|
+ INSERT IGNORE INTO
|
|
|
|
+ crawler_produce_id_map
|
|
|
|
+ (channel_content_id, content_id)
|
|
|
|
+ VALUES
|
|
|
|
+ (%s, %s);
|
|
|
|
+ """
|
|
|
|
+ await self.mysql_client.async_insert(
|
|
|
|
+ sql=insert_sql,
|
|
|
|
+ params={
|
|
|
|
+ self.channel_content_id,
|
|
|
|
+ self.content_id
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+
|
|
async def deal(self):
|
|
async def deal(self):
|
|
"""
|
|
"""
|
|
deal
|
|
deal
|
|
@@ -136,6 +157,10 @@ class Record(object):
|
|
# 记录数据
|
|
# 记录数据
|
|
await self.input_into_article_match_video_table()
|
|
await self.input_into_article_match_video_table()
|
|
await self.input_into_article_text_table()
|
|
await self.input_into_article_text_table()
|
|
|
|
+ # 判断是否传参数:channel_content_id
|
|
|
|
+ if self.channel_content_id:
|
|
|
|
+ await self.input_channel_content_id()
|
|
|
|
+
|
|
res = {
|
|
res = {
|
|
"status": "success input to article queue",
|
|
"status": "success input to article queue",
|
|
"code": 0,
|
|
"code": 0,
|