Files
rakuten-api/app/trading/api/routes/health.py
T
q792602257andClaude Opus 4.6 65e3ed31f8 交易服务收敛为仅 rakuten:移除 rakuma 登录态与下单入口
trading 不再管理 ラクマ 的购物车购买、支付与订单监控。删除 auth_site /
auth_session / login_runner / models.AuthSite 中的 rakuma 分支与常量、
account.yaml.example 的 rakuma 段,并清理相关测试。scraping 侧的
ラクマ 抓取 API(/api/rakuma/*)保留不动。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-28 11:50:07 +08:00

28 lines
971 B
Python

"""交易服务健康检查路由"""
from fastapi import APIRouter, Depends
from app.shared.api import ApiResponse, get_container
from app.trading.container import TradingContainer
from app.trading.models import TradingHealthData
router = APIRouter(tags=["health"])
@router.get("/health", response_model=ApiResponse[TradingHealthData])
async def health(
container: TradingContainer = Depends(get_container),
) -> ApiResponse[TradingHealthData]:
"""交易服务健康状态
auth 给出账号登录态。这里只读缓存、不触发网络探测,避免健康检查被
上游高频轮询时反复打站点;要实时结果请用 POST /api/auth/status。
注意 `logged_in=null` 表示服务启动后还没探测过,不等于未登录。
"""
return ApiResponse[TradingHealthData](
success=True,
msg="success",
data=TradingHealthData(status="ok", auth=container.auth_session.status_all()),
code=0,
)