Files

27 lines
1013 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""调试接口(仅开发/排障;生产环境请按需限制访问)。"""
from __future__ import annotations
from fastapi import APIRouter, Depends
from app.db import list_all_health_snapshots, list_all_measure_snapshots
from app.settings import Settings, get_settings
router = APIRouter(prefix="/api/v1/debug", tags=["debug"])
@router.get("/meause")
@router.get("/measure")
async def debug_list_measure_results(settings: Settings = Depends(get_settings)):
"""列出 SQLite 中已保存的全部 FishMeasure 计算结果(含每条鱼的 result / pred / star 等)。"""
items = list_all_measure_snapshots(settings)
return {"count": len(items), "items": items}
@router.get("/aciton")
@router.get("/action")
async def debug_list_action_results(settings: Settings = Depends(get_settings)):
"""列出 SQLite 中已保存的全部 FishAction 健康结果(含切片 source_path"""
items = list_all_health_snapshots(settings)
return {"count": len(items), "items": items}