按批次轮次和问题筛选展示笔记
This commit is contained in:
2
app.py
2
app.py
@@ -433,7 +433,7 @@ def create_app() -> Flask:
|
|||||||
|
|
||||||
@app.route("/api/v1/data-dashboard/ocr/configured-notes", methods=["GET"])
|
@app.route("/api/v1/data-dashboard/ocr/configured-notes", methods=["GET"])
|
||||||
def query_ocr_configured_notes():
|
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"])
|
@app.route("/api/v1/data-dashboard/ocr/evidences/export", methods=["GET"])
|
||||||
def export_ocr_dashboard_evidences():
|
def export_ocr_dashboard_evidences():
|
||||||
|
|||||||
@@ -201,13 +201,15 @@ def list_evidences(params: dict[str, Any]) -> dict[str, Any]:
|
|||||||
return data
|
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:
|
if not Config.EVIDENCE_ADMIN_BASE_URL:
|
||||||
return []
|
return []
|
||||||
try:
|
try:
|
||||||
response = SESSION.get(
|
response = SESSION.get(
|
||||||
f"{Config.EVIDENCE_ADMIN_BASE_URL}/api/notes",
|
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),
|
timeout=min(Config.CRAWLER_TIMEOUT_SECONDS, 15),
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|||||||
Reference in New Issue
Block a user