first commit

This commit is contained in:
2026-07-18 20:32:51 +08:00
commit 77bf076ad0
34 changed files with 4068 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from fastapi import APIRouter, HTTPException, status
from sqlalchemy import text
from app.deps import DbSession
router = APIRouter(tags=["系统"])
@router.get("/health")
async def health(db: DbSession) -> dict[str, str]:
try:
await db.execute(text("select 1"))
except Exception as exc:
raise HTTPException(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail="数据库不可用",
) from exc
return {"status": "ok", "database": "ok"}