27 lines
1013 B
Python
27 lines
1013 B
Python
"""调试接口(仅开发/排障;生产环境请按需限制访问)。"""
|
||
|
||
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}
|