Pārlūkot izejas kodu

修改账号为111个

罗俊辉 10 mēneši atpakaļ
vecāks
revīzija
6127a9785e
2 mainītis faili ar 35 papildinājumiem un 33 dzēšanām
  1. 2 1
      applications/deal/__init__.py
  2. 33 32
      applications/routes.py

+ 2 - 1
applications/deal/__init__.py

@@ -5,4 +5,5 @@ from .search_deal import SearchDeal
 from .re_search_deal import ReSearchDeal
 from .process_deal import ProcessDeal
 from .search_deal_v2 import SearchDeal2
-from .get_done_content_deal import ProcessDeal2
+from .get_done_content_deal import ProcessDeal2
+from .recall_deal import RecallDeal

+ 33 - 32
applications/routes.py

@@ -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():