按批次轮次和问题筛选展示笔记

This commit is contained in:
2026-09-02 15:34:16 +08:00
parent fc51e2a7c9
commit e4627e6ba3
2 changed files with 4 additions and 2 deletions

2
app.py
View File

@@ -433,7 +433,7 @@ def create_app() -> Flask:
@app.route("/api/v1/data-dashboard/ocr/configured-notes", methods=["GET"])
def query_ocr_configured_notes():
return jsonify({"data": list_ocr_configured_notes(), "request_id": g.request_id})
return jsonify({"data": list_ocr_configured_notes(request.args.to_dict()), "request_id": g.request_id})
@app.route("/api/v1/data-dashboard/ocr/evidences/export", methods=["GET"])
def export_ocr_dashboard_evidences():

View File

@@ -201,13 +201,15 @@ def list_evidences(params: dict[str, Any]) -> dict[str, Any]:
return data
def list_configured_notes() -> list[dict[str, Any]]:
def list_configured_notes(params: dict[str, Any] | None = None) -> list[dict[str, Any]]:
"""读取凭证后台中由用户配置的多篇展示笔记。"""
if not Config.EVIDENCE_ADMIN_BASE_URL:
return []
try:
response = SESSION.get(
f"{Config.EVIDENCE_ADMIN_BASE_URL}/api/notes",
params={key: value for key, value in (params or {}).items()
if key in {"batch_key", "collection_key", "question_code"} and value},
timeout=min(Config.CRAWLER_TIMEOUT_SECONDS, 15),
)
response.raise_for_status()