feat 转移历史记录文件清单

This commit is contained in:
jxxghp
2023-08-12 18:11:20 +08:00
parent bd163f9c4b
commit 61d44a6e7d
9 changed files with 48 additions and 9 deletions

View File

@ -45,3 +45,7 @@ class DownloadHistory(Base):
@staticmethod
def list_by_page(db: Session, page: int = 1, count: int = 30):
return db.query(DownloadHistory).offset((page - 1) * count).limit(count).all()
@staticmethod
def get_by_path(db: Session, path: str):
return db.query(DownloadHistory).filter(DownloadHistory.path == path).first()

View File

@ -43,6 +43,8 @@ class TransferHistory(Base):
errmsg = Column(String)
# 时间
date = Column(String, index=True)
# 文件清单以JSON存储
files = Column(String)
@staticmethod
def list_by_title(db: Session, title: str, page: int = 1, count: int = 30):

View File

@ -15,7 +15,7 @@ class TransferHistoryOper(DbOper):
按标题查询转移记录
:param title: 数据key
"""
return TransferHistory.search_by_title(self._db, title)
return TransferHistory.list_by_title(self._db, title)
def get_by_src(self, src: str) -> Any:
"""