罗俊辉 11 months ago
parent
commit
bd89429888
2 changed files with 10 additions and 3 deletions
  1. 4 1
      deal/db_deal.py
  2. 6 2
      test_req.py

+ 4 - 1
deal/db_deal.py

@@ -30,4 +30,7 @@ async def get_text_by_id(mysql_client, video_id):
     """
     select_sql = f"""select video_text from video_text where video_id = {video_id}"""
     result = await mysql_client.select(select_sql)
-    return result[0]
+    if result:
+        return result[0]
+    else:
+        return None

+ 6 - 2
test_req.py

@@ -5,10 +5,14 @@ import json
 import time
 import requests
 
-url = "http://localhost:8888/videos"
+"""
+cate: video_return, video_view, video_rov
+"""
+
+url = "http://47.99.132.47:8888/videos"
 
 body = {
-    "cate": "video_return",
+    "cate": "video_rov",
     "start_date": "2024-05-28",
     "end_date": "2024-05-29",
     "topN": 10