定时任务优化

This commit is contained in:
lhx
2025-11-18 09:41:52 +08:00
parent 815cd7801c
commit d8b6247094
4 changed files with 86 additions and 30 deletions

View File

@@ -58,6 +58,13 @@ class AccountService:
return AccountResponse.from_orm_account(account)
return None
@staticmethod
def get_accounts_batch(db: Session, account_ids: List[int]) -> List[Account]:
"""批量根据ID列表获取账号数据返回模型对象用于批量关联"""
if not account_ids:
return []
return db.query(Account).filter(Account.id.in_(account_ids)).all()
@staticmethod
def get_account_by_username(db: Session, username: str) -> Optional[Account]:
"""根据用户名获取账号"""