Browse Source

增加 check_trace_id 的方法

luojunhui 4 months ago
parent
commit
77f90240e6
1 changed files with 15 additions and 0 deletions
  1. 15 0
      server/api/response.py

+ 15 - 0
server/api/response.py

@@ -303,6 +303,21 @@ class Response(object):
                     "message": "该任务正在执行中"
                 }
 
+    async def check_trace_id(self):
+        """
+        check trace id 是否存在与系统中
+        """
+        select_sql = f"""
+            SELECT trace_id
+            FROM {self.article_match_video_table}
+            WHERE trace_id = '{self.trace_id}';
+            """
+        response = await self.mysql_client.async_select(select_sql)
+        if response:
+            return True
+        else:
+            return False
+
     async def deal(self):
         """
         api process starts from here