feat: add tenant-scoped rule and permission management

This commit is contained in:
wren
2026-05-21 22:03:08 +08:00
parent a2c2bf1969
commit 1f1bccf3b3
193 changed files with 64463 additions and 1771 deletions
@@ -16,7 +16,8 @@ class IGovdocService(ABC):
self,
file: UploadFile,
typeId: int | None = None,
region: str = "default",
region: str | None = None,
tenantCode: str | None = None,
autoRun: bool = False,
speed: str = "normal",
ruleVersionId: int | None = None,
@@ -33,6 +34,7 @@ class IGovdocService(ABC):
keyword: str | None = None,
fileExt: str | None = None,
region: str | None = None,
tenantCode: str | None = None,
status: str | None = None,
resultStatus: str | None = None,
createdBy: int | None = None,
@@ -73,54 +75,54 @@ class IGovdocService(ABC):
...
@abstractmethod
async def GetRunStatus(self, runId: int) -> dict[str, Any]:
async def GetRunStatus(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""查询 run 状态、阶段、耗时、错误摘要。"""
...
# ── 结果与报告 ────────────────────────────────────────
@abstractmethod
async def GetRunResult(self, runId: int) -> dict[str, Any]:
async def GetRunResult(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取审查结果摘要:summary + checked rules + findings 统计 + entities 摘要。"""
...
@abstractmethod
async def GetRunFindings(self, runId: int) -> dict[str, Any]:
async def GetRunFindings(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取段落级 findings 明细列表。"""
...
@abstractmethod
async def GetRunEntities(self, runId: int) -> dict[str, Any]:
async def GetRunEntities(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取识别出的标题、文号、署名等实体。"""
...
@abstractmethod
async def GetRunParagraphs(self, runId: int) -> dict[str, Any]:
async def GetRunParagraphs(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取前端文档联动视图所需的段落 HTML。"""
...
@abstractmethod
async def GetRunStructure(self, runId: int) -> dict[str, Any]:
async def GetRunStructure(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取文档结构统计(结构面板数据)。"""
...
@abstractmethod
async def GetRunOutline(self, runId: int) -> dict[str, Any]:
async def GetRunOutline(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取文档大纲树(大纲面板数据)。"""
...
@abstractmethod
async def GetReportHtml(self, runId: int) -> dict[str, Any]:
async def GetReportHtml(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取 HTML 报告内容或下载地址。"""
...
@abstractmethod
async def GetReportDocx(self, runId: int) -> dict[str, Any]:
async def GetReportDocx(self, runId: int, userId: int | None = None) -> dict[str, Any]:
"""获取批注 DOCX 下载地址。"""
...
@abstractmethod
async def DownloadOriginal(self, documentId: int) -> dict[str, Any]:
async def DownloadOriginal(self, documentId: int, userId: int | None = None) -> dict[str, Any]:
"""获取原始上传文档下载地址。"""
...