feat: new file
This commit is contained in:
18
backend/app/routes/debug.py
Normal file
18
backend/app/routes/debug.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Query
|
||||
|
||||
from ..services.db_sample import print_db_sample_to_logs
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post("/db-sample")
|
||||
def db_sample(limit: int = Query(10, ge=1, le=200)):
|
||||
"""
|
||||
触发一次“数据库样例打印到后端日志”,用于快速理解数据内容与结构。
|
||||
"""
|
||||
print_db_sample_to_logs(limit=limit)
|
||||
return {"ok": True, "printed": True, "limit": limit}
|
||||
|
||||
Reference in New Issue
Block a user