19 lines
455 B
Python
19 lines
455 B
Python
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}
|
|
|