Initial project commit

This commit is contained in:
2026-05-09 16:40:29 +08:00
commit 02b0259a9e
267 changed files with 54891 additions and 0 deletions
@@ -0,0 +1,25 @@
from sqlalchemy.ext.asyncio import AsyncSession
from app.models.notification import Notification
async def send_notification(
db: AsyncSession,
user_id: int,
type: str,
title: str,
content: str | None = None,
ref_type: str | None = None,
ref_id: int | None = None,
):
n = Notification(
user_id=user_id,
type=type,
title=title,
content=content,
ref_type=ref_type,
ref_id=ref_id,
)
db.add(n)
await db.flush()
return n