feat(ocr-dashboard): 透传按主体名跨批次采集记录接口

- ocr_dashboard_service.py 新增 list_collections_by_subject() 函数
- get_series() 增加 subject_name 参数
- app.py 新增路由 /api/v1/data-dashboard/ocr/batches/subject/<subject_name>/collections
- 透传代理至 xiaoti-framework crawler 服务
This commit is contained in:
2026-09-02 18:27:00 +08:00
parent fe15b11733
commit 26e91597ab
2 changed files with 22 additions and 2 deletions

10
app.py
View File

@@ -23,6 +23,7 @@ from ocr_dashboard_service import (
get_summary as get_ocr_dashboard_summary,
list_batches as list_ocr_batches,
list_collections as list_ocr_collections,
list_collections_by_subject as list_ocr_collections_by_subject,
list_evidences as list_ocr_evidences,
list_configured_notes as list_ocr_configured_notes,
export_evidences as export_ocr_evidences,
@@ -393,6 +394,14 @@ def create_app() -> Flask:
def query_ocr_dashboard_collections(batch_key: str):
return jsonify({"data": list_ocr_collections(batch_key), "request_id": g.request_id})
@app.route("/api/v1/data-dashboard/ocr/batches/subject/<subject_name>/collections", methods=["GET"])
def query_ocr_collections_by_subject(subject_name: str):
return jsonify({"data": list_ocr_collections_by_subject(
subject_name,
request.args.get("start_date", "").strip(),
request.args.get("end_date", "").strip(),
), "request_id": g.request_id})
@app.route("/api/v1/data-dashboard/ocr/summary", methods=["GET"])
def query_ocr_dashboard_summary():
return jsonify({"data": get_ocr_dashboard_summary(
@@ -406,6 +415,7 @@ def create_app() -> Flask:
def query_ocr_dashboard_series():
return jsonify({"data": get_ocr_dashboard_series(
request.args.get("batch_key", "").strip(),
request.args.get("subject_name", "").strip(),
request.args.get("start_date", "").strip(),
request.args.get("end_date", "").strip(),
), "request_id": g.request_id})