21 lines
516 B
Python
21 lines
516 B
Python
from fastapi import APIRouter, Depends
|
|
|
|
from app.core.config import Settings, get_settings
|
|
from app.schemas.api import HealthResponse
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get(
|
|
"/health",
|
|
response_model=HealthResponse,
|
|
summary="健康检查",
|
|
description="用于负载均衡器、容器探针和运维监控。",
|
|
)
|
|
def health(settings: Settings = Depends(get_settings)) -> HealthResponse:
|
|
return HealthResponse(
|
|
status="ok",
|
|
environment=settings.app_env,
|
|
version="6.0.0",
|
|
)
|