import os import sys from datetime import datetime sys.path.append(os.getcwd()) from utils.mysql_db import MysqlHelper class sqlCollect: """ 获取长文oss地址 """ @classmethod def get_oss_path(cls): sql = """ SELECT title, oss_path FROM video_end_screen_transformation_task WHERE status = 0 ORDER BY task_id DESC LIMIT 1; """ data = MysqlHelper.get_values(sql) return data @classmethod def update_oss_path_status(cls, status, oss_path): sql = f"""UPDATE video_end_screen_transformation_task set status = {status} where oss_path = '{oss_path}'""" res = MysqlHelper.update_values( sql=sql ) return res @classmethod def add_new_oss_path(cls, new_oss_path, oss_path): sql = f"""UPDATE video_end_screen_transformation_task set new_oss_path = '{new_oss_path}' where oss_path = '{oss_path}'""" res = MysqlHelper.update_values( sql=sql ) return res