定时任务优化
This commit is contained in:
@@ -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]:
|
||||
"""根据用户名获取账号"""
|
||||
|
||||
Reference in New Issue
Block a user