feat: add document type CRUD with inline rule set binding

- GET/POST /api/document-types, GET/PUT/DELETE /api/document-types/{id}
- DocumentTypeItemVO extended with description, entryModuleId,
  isEnabled, ruleSetIds
- Create/Update DTOs accept ruleSetIds array for automatic
  leaudit_rule_type_bindings sync (full replace on update)
- Soft delete cascades to rule_type_bindings
This commit is contained in:
wren
2026-04-30 12:50:56 +08:00
parent 32f56f7bf6
commit 52c2bed4f9
4 changed files with 265 additions and 30 deletions
@@ -2,7 +2,13 @@
from abc import ABC, abstractmethod
from fastapi_modules.fastapi_leaudit.domian.vo.documentVo import DocumentListPageVO, DocumentTypeItemVO, DocumentUploadVO
from fastapi_modules.fastapi_leaudit.domian.vo.documentVo import (
DocumentListPageVO,
DocumentTypeCreateDTO,
DocumentTypeItemVO,
DocumentTypeUpdateDTO,
DocumentUploadVO,
)
class IDocumentService(ABC):
@@ -46,3 +52,23 @@ class IDocumentService(ABC):
async def ListDocumentTypes(self, Ids: list[int] | None = None) -> list[DocumentTypeItemVO]:
"""获取文档类型列表。"""
...
@abstractmethod
async def GetDocumentType(self, Id: int) -> DocumentTypeItemVO:
"""获取文档类型详情。"""
...
@abstractmethod
async def CreateDocumentType(self, Body: DocumentTypeCreateDTO) -> DocumentTypeItemVO:
"""创建文档类型。"""
...
@abstractmethod
async def UpdateDocumentType(self, Id: int, Body: DocumentTypeUpdateDTO) -> DocumentTypeItemVO:
"""更新文档类型。"""
...
@abstractmethod
async def DeleteDocumentType(self, Id: int) -> None:
"""删除文档类型(软删除)。"""
...