|
@@ -5,7 +5,7 @@ from quart import Blueprint, jsonify, request
|
|
|
|
|
|
from applications.functions.log import logging
|
|
|
from applications.schedule import recall_videos
|
|
|
-from applications.deal import ReSearchDeal, SearchDeal2, ProcessDeal
|
|
|
+from applications.deal import SearchDeal2, ProcessDeal, RecallDeal
|
|
|
|
|
|
my_blueprint = Blueprint('LongArticles', __name__)
|
|
|
|
|
@@ -35,43 +35,44 @@ def Routes(mysql_client):
|
|
|
return jsonify(result)
|
|
|
|
|
|
@my_blueprint.route('/recall_videos', methods=['POST'])
|
|
|
- async def find_videos():
|
|
|
+ async def recall_results():
|
|
|
"""
|
|
|
- 请求接口代码
|
|
|
+ 获取视频分享卡片
|
|
|
:return:
|
|
|
"""
|
|
|
data = await request.get_json()
|
|
|
trace_id = data['traceId']
|
|
|
- logging(
|
|
|
- code="1001",
|
|
|
- info="请求接口成功",
|
|
|
- port="recall_videos",
|
|
|
- trace_id=trace_id
|
|
|
- )
|
|
|
- try:
|
|
|
- result = await recall_videos(
|
|
|
- trace_id=trace_id,
|
|
|
- mysql_client=mysql_client
|
|
|
- )
|
|
|
- print(result)
|
|
|
- except Exception as e:
|
|
|
- result = {
|
|
|
- "traceId": trace_id,
|
|
|
- "error": str(e)
|
|
|
- }
|
|
|
- print(result)
|
|
|
- return jsonify(result)
|
|
|
+ minigram_type = data['miniprogramUseType']
|
|
|
+ RD = RecallDeal(trace_id=trace_id, mini_program_type=minigram_type, mysql_client=mysql_client)
|
|
|
+ response = await RD.deal()
|
|
|
+ return jsonify(response)
|
|
|
|
|
|
- @my_blueprint.route('/re_search_videos', methods=['POST'])
|
|
|
- async def ree_search_videos():
|
|
|
- """
|
|
|
- 重新搜索
|
|
|
- :return:
|
|
|
- """
|
|
|
- params = await request.get_json()
|
|
|
- RSD = ReSearchDeal(params=params)
|
|
|
- res = await RSD.deal()
|
|
|
- return jsonify(res)
|
|
|
+ # async def find_videos():
|
|
|
+ # """
|
|
|
+ # 请求接口代码
|
|
|
+ # :return:
|
|
|
+ # """
|
|
|
+ # data = await request.get_json()
|
|
|
+ # trace_id = data['traceId']
|
|
|
+ # logging(
|
|
|
+ # code="1001",
|
|
|
+ # info="请求接口成功",
|
|
|
+ # port="recall_videos",
|
|
|
+ # trace_id=trace_id
|
|
|
+ # )
|
|
|
+ # try:
|
|
|
+ # result = await recall_videos(
|
|
|
+ # trace_id=trace_id,
|
|
|
+ # mysql_client=mysql_client
|
|
|
+ # )
|
|
|
+ # print(result)
|
|
|
+ # except Exception as e:
|
|
|
+ # result = {
|
|
|
+ # "traceId": trace_id,
|
|
|
+ # "error": str(e)
|
|
|
+ # }
|
|
|
+ # print(result)
|
|
|
+ # return jsonify(result)
|
|
|
|
|
|
@my_blueprint.route("/task")
|
|
|
async def schedule_task():
|