refactor: region from document, not app config

- Add region column to leaudit_documents + LeauditDocument model
- AuditServiceImpl: read region from document.region, not APP_REGION
- RuleServiceImpl: ListBindings/CreateBinding accept Region parameter
- RuleBindingCreateDTO: add region field
- RuleController: pass region from query param/DTO to service
- APP_REGION removed from binding queries; region flows from document

Region is now per-document: each document carries its region at upload
time, and rules are matched to the document's region at run time.
This commit is contained in:
wren
2026-04-28 14:19:29 +08:00
parent e80e8febd8
commit c776af598a
6 changed files with 65 additions and 15 deletions
@@ -66,8 +66,8 @@ class IRuleService(ABC):
...
@abstractmethod
async def ListBindings(self, RuleType: str | None = None) -> list[RuleBindingVO]:
"""列出规则类型绑定。可按规则类型过滤。"""
async def ListBindings(self, RuleType: str | None = None, Region: str | None = None) -> list[RuleBindingVO]:
"""列出规则类型绑定。可按规则类型/地区过滤。"""
...
@abstractmethod
@@ -75,6 +75,7 @@ class IRuleService(ABC):
self,
DocTypeId: int,
RuleSetId: int,
Region: str = "default",
BindingMode: str = "explicit",
Priority: int = 0,
DocTypeCode: str | None = None,