feat(backend): 实现多租户数据隔离与权限管理架构

refactor(backend): 重构模型基类支持租户与客户隔离
feat(backend): 添加客户模块相关模型、CRUD和参数校验
docs(backend): 新增SaaS数据隔离设计方案文档
refactor(backend): 优化日志模块并添加类型注解
fix(backend): 修正字典模块查询参数移除creator字段

style(frontend): 统一按钮组件代码格式
fix(frontend): 修复表格序号计算逻辑
chore(frontend): 更新lint脚本使用pnpm替代npm
This commit is contained in:
zhangtao
2025-11-23 18:59:43 +08:00
parent 749c97f4e3
commit 9a39a64faf
54 changed files with 5952 additions and 588 deletions
+5 -3
View File
@@ -10,14 +10,11 @@ from sqlalchemy.engine.row import Row
from sqlalchemy.orm.collections import InstrumentedList
from sqlalchemy.sql.expression import TextClause, null
from app.config.setting import settings
from app.core.logger import log
from app.core.exceptions import CustomException
def import_module(module: str, desc: str) -> Any:
"""
动态导入模块
@@ -79,6 +76,11 @@ def get_random_character() -> str:
return uuid.uuid4().hex
def uuid4_str() -> str:
"""数据库引擎 UUID 类型兼容性解决方案"""
return str(uuid.uuid4())
def get_parent_id_map(model_list: Sequence[DeclarativeBase]) -> Dict[int, int]:
"""
获取父级 ID 映射字典