fix 订阅刷新站点范围扩大问题

This commit is contained in:
jxxghp
2024-05-24 12:31:11 +08:00
parent a2b0c9bd3a
commit 27b4f206a1
4 changed files with 32 additions and 2 deletions

View File

@ -69,6 +69,12 @@ class Site(Base):
result = db.query(Site).order_by(Site.pri).all()
return list(result)
@staticmethod
@db_query
def get_domains_by_ids(db: Session, ids: list):
result = db.query(Site.domain).filter(Site.id.in_(ids)).all()
return [r[0] for r in result]
@staticmethod
@db_update
def reset(db: Session):

View File

@ -63,6 +63,12 @@ class SiteOper(DbOper):
"""
return Site.get_by_domain(self._db, domain)
def get_domains_by_ids(self, ids: List[int]) -> List[str]:
"""
按ID获取站点域名
"""
return Site.get_domains_by_ids(self._db, ids)
def exists(self, domain: str) -> bool:
"""
判断站点是否存在