diff --git a/python-api/app/main.py b/python-api/app/main.py index fb8e02a..d015812 100644 --- a/python-api/app/main.py +++ b/python-api/app/main.py @@ -286,6 +286,16 @@ def create_app() -> FastAPI: }, ) + # 健康检查(根路径,供 Docker/Nginx 负载均衡使用) + @app.get("/health", tags=["System"]) + async def health_check(): + """服务健康检查""" + return ApiResponse( + code=200, + data={"status": "healthy"}, + message="服务运行正常", + ) + # 根路由 @app.get("/", tags=["System"]) async def root():