Analyze all unanalyzed documents
()
| 73 | |
| 74 | @document_bp.route("/documents/analyze", methods=["POST"]) |
| 75 | def analyze_documents(): |
| 76 | """Analyze all unanalyzed documents""" |
| 77 | try: |
| 78 | analyzed_doc_dtos = document_service.analyze_all_documents() |
| 79 | return jsonify( |
| 80 | APIResponse.success( |
| 81 | data={ |
| 82 | "total": len(analyzed_doc_dtos), |
| 83 | "documents": [doc.dict() for doc in analyzed_doc_dtos], |
| 84 | } |
| 85 | ) |
| 86 | ) |
| 87 | except Exception as e: |
| 88 | logger.error(f"Error analyzing documents: {str(e)}", exc_info=True) |
| 89 | return jsonify( |
| 90 | APIResponse.error(message=f"Error analyzing documents: {str(e)}") |
| 91 | ) |
| 92 | |
| 93 | |
| 94 | @document_bp.route("/documents/<int:document_id>/l0", methods=["GET"]) |
nothing calls this directly
no test coverage detected