|
@@ -8,8 +8,9 @@ from applications.functions.common import request_for_info, create_gzh_path
|
|
from applications.functions.log import logging
|
|
from applications.functions.log import logging
|
|
|
|
|
|
|
|
|
|
-async def return_info_v2(video_id, trace_id):
|
|
|
|
|
|
+async def return_info_v2(video_id, trace_id, mysql_client):
|
|
"""
|
|
"""
|
|
|
|
+ :param mysql_client:
|
|
:param trace_id:
|
|
:param trace_id:
|
|
:param video_id:
|
|
:param video_id:
|
|
:return:
|
|
:return:
|
|
@@ -42,6 +43,15 @@ async def return_info_v2(video_id, trace_id):
|
|
"videoUrl": videoUrl,
|
|
"videoUrl": videoUrl,
|
|
"paragraphPosition": 0.25
|
|
"paragraphPosition": 0.25
|
|
}
|
|
}
|
|
|
|
+ update_result_sql = f"""
|
|
|
|
+ UPDATE long_articles_video
|
|
|
|
+ SET
|
|
|
|
+ result1 = '{json.dumps(result, ensure_ascii=False)}',
|
|
|
|
+ success = 1
|
|
|
|
+ WHERE
|
|
|
|
+ trace_id = '{trace_id}'
|
|
|
|
+ """
|
|
|
|
+ await mysql_client.async_insert(update_result_sql)
|
|
logging(
|
|
logging(
|
|
code="2000",
|
|
code="2000",
|
|
info="root_share_id和source_id",
|
|
info="root_share_id和source_id",
|
|
@@ -53,10 +63,7 @@ async def return_info_v2(video_id, trace_id):
|
|
"sourceId": source_id
|
|
"sourceId": source_id
|
|
}
|
|
}
|
|
)
|
|
)
|
|
- return {
|
|
|
|
- "traceId": trace_id,
|
|
|
|
- "miniprogramList": [result]
|
|
|
|
- }
|
|
|
|
|
|
+ return result
|
|
|
|
|
|
|
|
|
|
async def return_info(video_id, kimi_title, trace_id, mysql_client, index):
|
|
async def return_info(video_id, kimi_title, trace_id, mysql_client, index):
|
|
@@ -128,7 +135,7 @@ async def recall_videos(trace_id, mysql_client):
|
|
:return:
|
|
:return:
|
|
"""
|
|
"""
|
|
select_sql = f"""
|
|
select_sql = f"""
|
|
- SELECT recall_video_id1,recall_video_id2, recall_video_id3, kimi_title
|
|
|
|
|
|
+ SELECT recall_video_id1, recall_video_id2, recall_video_id3, kimi_title
|
|
FROM long_articles_video
|
|
FROM long_articles_video
|
|
WHERE trace_id = '{trace_id}';
|
|
WHERE trace_id = '{trace_id}';
|
|
"""
|
|
"""
|
|
@@ -145,13 +152,20 @@ async def recall_videos(trace_id, mysql_client):
|
|
trace_id=trace_id
|
|
trace_id=trace_id
|
|
)
|
|
)
|
|
for index, best_video_id in enumerate(unEmptyList, 1):
|
|
for index, best_video_id in enumerate(unEmptyList, 1):
|
|
- temp = await return_info(
|
|
|
|
- video_id=best_video_id,
|
|
|
|
- kimi_title=kimi_title,
|
|
|
|
- trace_id=trace_id,
|
|
|
|
- mysql_client=mysql_client,
|
|
|
|
- index=index
|
|
|
|
- )
|
|
|
|
|
|
+ if kimi_title:
|
|
|
|
+ temp = await return_info(
|
|
|
|
+ video_id=best_video_id,
|
|
|
|
+ kimi_title=kimi_title,
|
|
|
|
+ trace_id=trace_id,
|
|
|
|
+ mysql_client=mysql_client,
|
|
|
|
+ index=index
|
|
|
|
+ )
|
|
|
|
+ else:
|
|
|
|
+ temp = await return_info_v2(
|
|
|
|
+ video_id=best_video_id,
|
|
|
|
+ trace_id=trace_id,
|
|
|
|
+ mysql_client=mysql_client
|
|
|
|
+ )
|
|
L.append(temp)
|
|
L.append(temp)
|
|
result = {
|
|
result = {
|
|
"traceId": trace_id,
|
|
"traceId": trace_id,
|