초기 커밋
This commit is contained in:
32
app/api/v1/endpoints/system.py
Normal file
32
app/api/v1/endpoints/system.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.api.deps import get_session
|
||||
from app.core.config import settings
|
||||
from app.core.constants import Role
|
||||
from app.core.dependencies import require_role
|
||||
|
||||
router = APIRouter(prefix="/system", tags=["system"])
|
||||
|
||||
|
||||
@router.get("/health")
|
||||
async def health_check() -> dict:
|
||||
return {
|
||||
"status": "ok",
|
||||
"service": settings.APP_NAME,
|
||||
"version": "0.1.0",
|
||||
}
|
||||
|
||||
|
||||
@router.get("/info")
|
||||
async def system_info(
|
||||
_: dict = Depends(require_role(Role.SUPERADMIN)),
|
||||
) -> dict:
|
||||
return {
|
||||
"app_name": settings.APP_NAME,
|
||||
"environment": settings.APP_ENV,
|
||||
"debug": settings.DEBUG,
|
||||
"api_prefix": settings.API_V1_PREFIX,
|
||||
}
|
||||
Reference in New Issue
Block a user