mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-24 05:26:58 +00:00
本次提交进行了大规模的系统重构: 1. 拆分租户相关模块到platform平台层,重构租户表名与关联关系 2. 迁移日志、工单、插件等模块到对应层级,统一代码结构 3. 重构批量操作接口路径,从/available/setting改为/status/batch 4. 新增批量删除基础模型,统一处理批量操作逻辑 5. 优化导入导出接口,修正路由方法与描述信息 6. 修复循环引用问题,重构依赖注入与类型导入 7. 更新初始化脚本与路由注册,新增平台管理路由 8. 重构岗位模型,新增岗位编码字段与校验 9. 完善部门删除逻辑,新增子部门删除限制 10. 更新初始化数据与配置文件,适配新架构
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
from typing import TYPE_CHECKING
|
|
|
|
from sqlalchemy import Integer, String
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from app.core.base_model import ModelMixin, TenantMixin, UserMixin
|
|
|
|
if TYPE_CHECKING:
|
|
from app.api.v1.module_system.user.model import UserModel
|
|
|
|
|
|
class PositionModel(ModelMixin, TenantMixin, UserMixin):
|
|
"""
|
|
岗位模型
|
|
"""
|
|
|
|
__tablename__: str = "sys_position"
|
|
__table_args__: dict[str, str] = {"comment": "岗位表"}
|
|
__loader_options__: list[str] = ["users", "created_by", "updated_by", "deleted_by"]
|
|
|
|
name: Mapped[str] = mapped_column(String(64), nullable=False, comment="岗位名称")
|
|
code: Mapped[str] = mapped_column(String(64), nullable=False, comment="岗位编码")
|
|
order: Mapped[int] = mapped_column(Integer, nullable=False, default=1, comment="显示排序")
|
|
|
|
# 关联关系
|
|
users: Mapped[list["UserModel"]] = relationship(
|
|
secondary="sys_user_positions",
|
|
back_populates="positions",
|
|
lazy="selectin",
|
|
)
|