feat: initialize aivideo project

This commit is contained in:
2026-04-17 18:33:05 +08:00
commit 14b18d67fe
162 changed files with 26251 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
from sqlalchemy import or_, select
from sqlalchemy.orm import Session
from app.models.entities import User
class AuthRepository:
def __init__(self, db: Session) -> None:
self.db = db
def get_user_by_account(self, account: str) -> User | None:
return self.db.scalar(
select(User).where(
or_(
User.email == account,
User.mobile == account,
User.username == account,
)
)
)
def get_user_by_public_id(self, public_id: str) -> User | None:
return self.db.scalar(select(User).where(User.public_id == public_id))