报告
生成分类 / 审计 / 合规报告,读取 Markdown 正文与 HTML 预览。
报告把分级结果汇成一份可交付、可辩护的文档。生成是异步的,生成后可读 Markdown 正文、HTML 预览或结构化数据。
生成报告
text
POST /api/v1/reports/generate需 superadmin / admin 角色。
请求体
| 字段 | 类型 | 默认 | 说明 |
|---|---|---|---|
schema_id | UUID | null | — | 针对某个 schema 出报告 |
report_type | string | classification | classification / audit / compliance / team_quality / protection_gap |
scope_id | string | null | — | 范围 ID |
scope_name | string | null | — | 范围名称 |
metadata | object | null | — | 附加元数据 |
响应(201 Created)
json
{
"id": "9c8b...",
"report_type": "classification",
"version": 1,
"status": "generating",
"generated_at": null,
"created_at": "2026-05-20T09:00:00Z"
}读取报告
text
GET /api/v1/reports/{report_id}返回报告详情,含 markdown_content(正文)、pdf_path、word_path、status、version。
HTML 预览
text
GET /api/v1/reports/{report_id}/preview返回 { "html": "..." },由 Markdown 渲染而成,可直接嵌入页面预览。
列出报告
text
GET /api/v1/reports?report_type=classification可按 schema_id / report_type 过滤。
结构化数据
需要在自己的前端里富渲染报告?用 GET /api/v1/reports/{id}/data 拿结构化数据,而不是解析 Markdown。