Files
LoveACE-EndF/loveace/router/endpoint/utils/alive.py
Sibuxiangx bbc86b8330 ⚒️ 重大重构 LoveACE V2
引入了 mongodb
对数据库进行了一定程度的数据加密
性能改善
代码简化
统一错误模型和响应
使用 apifox 作为文档
2025-11-20 20:44:25 +08:00

36 lines
756 B
Python

from fastapi import APIRouter
from pydantic import BaseModel, Field
class AliveResponse(BaseModel):
message: str = Field(
default="LoveACE is alive and running!", description="服务状态消息"
)
alive_router = APIRouter()
@alive_router.get(
"/alive",
response_model=AliveResponse,
tags=["服务健康检查"],
summary="服务健康检查接口",
)
async def alive_check():
"""
服务健康检查接口
✅ 功能特性:
- 返回服务运行状态
- 提供简单的健康检查响应
💡 使用场景:
- 监控服务状态
- 负载均衡器健康检查
Returns:
AliveResponse: 包含服务状态消息的响应模型
"""
return AliveResponse()