feat: add document versioning and list API
This commit is contained in:
@@ -52,7 +52,7 @@ LeAudit 有一套自己的 SQLAlchemy ORM 表(`storage/models/`)。**leaudit
|
||||
|
||||
| # | 表名 | 用途 | 状态 |
|
||||
|---|------|------|------|
|
||||
| 1 | `leaudit_documents` | LeAudit 域文档镜像,关联业务文档 | ✅ 已创建 |
|
||||
| 1 | `leaudit_documents` | LeAudit 平台内部文档主表 | ✅ 已创建 |
|
||||
| 2 | `leaudit_document_files` | 文档文件版本管理 | ✅ 已创建 |
|
||||
| 3 | `leaudit_audit_runs` | 每次处理执行的主索引记录 | ✅ 已创建 |
|
||||
| 4 | `leaudit_artifacts` | OCR/normalize/manifest/markdown/图片等文件产物索引 | ✅ 已创建 |
|
||||
@@ -79,12 +79,12 @@ LeAudit 有一套自己的 SQLAlchemy ORM 表(`storage/models/`)。**leaudit
|
||||
|
||||
### 4.1 `leaudit_documents`
|
||||
|
||||
LeAudit 域文档镜像表。通过 `biz_document_id` 关联老系统 `documents.id`。
|
||||
LeAudit 平台内部文档主表。当前不再依赖旧系统文档表。
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `id` | bigint PK | 主键,自增 |
|
||||
| `biz_document_id` | bigint UNIQUE | 关联老业务 `documents.id` |
|
||||
| `biz_document_id` | bigint UNIQUE | 内部追踪号,沿用旧字段名以兼容历史库 |
|
||||
| `type_id` | bigint | 文档类型 ID → `leaudit_document_types.id` |
|
||||
| `processing_status` | varchar(64) | waiting / running / completed / failed |
|
||||
| `current_run_id` | bigint | 最新有效 `leaudit_audit_runs.id` |
|
||||
@@ -179,7 +179,7 @@ LeAudit 域文档镜像表。通过 `biz_document_id` 关联老系统 `documents
|
||||
```text
|
||||
leaudit_entry_modules
|
||||
└── leaudit_document_types
|
||||
├── leaudit_documents ── biz_document_id → 老系统 documents
|
||||
├── leaudit_documents
|
||||
│ ├── leaudit_document_files
|
||||
│ └── leaudit_audit_runs
|
||||
│ ├── leaudit_artifacts (N)
|
||||
@@ -214,6 +214,7 @@ artifacts/{region}/{run_id}/{artifact_type}/{detail}.{ext}
|
||||
## 9. 最终结论
|
||||
|
||||
- 所有表 `leaudit_*` 前缀,与老系统完全隔离
|
||||
- `leaudit_documents` 现阶段是平台内部文档主表,不再要求外部 `documents.id`
|
||||
- `leaudit_audit_runs` 是每次处理的唯一追踪单位
|
||||
- `leaudit_artifacts` 统一管理所有文件产物,数据库只存索引
|
||||
- `leaudit_rule_results` 粒度到逐条规则,结构与 LeAudit `RuleResult` 对齐
|
||||
|
||||
Reference in New Issue
Block a user