2026-07-21 09:23:43 +08:00
|
|
|
|
from fastapi import APIRouter
|
2026-07-16 13:47:37 +08:00
|
|
|
|
|
|
|
|
|
|
from app.core.logging import get_logger
|
2026-08-03 17:24:45 +08:00
|
|
|
|
from app.db.platform_store import get_platform_store
|
2026-07-16 13:47:37 +08:00
|
|
|
|
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
logger = get_logger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.get("/health")
|
2026-07-21 09:23:43 +08:00
|
|
|
|
async def health_check() -> dict[str, object]:
|
2026-07-16 13:47:37 +08:00
|
|
|
|
logger.info("health check requested")
|
2026-08-03 15:49:21 +08:00
|
|
|
|
return {
|
|
|
|
|
|
"code": 0,
|
|
|
|
|
|
"message": "ok",
|
2026-08-03 17:24:45 +08:00
|
|
|
|
"data": get_platform_store().health_metrics(),
|
2026-08-03 15:49:21 +08:00
|
|
|
|
}
|
2026-07-21 09:23:43 +08:00
|
|
|
|
|