Files
FastapiAdmin/backend/app/api/v1/module_system/position/model.py
T
zhangtao d50dd9dd1e style: 移除Python文件中的编码声明并优化代码格式
refactor: 重构前端组件和样式,添加AI助手功能

docs: 更新README文档,添加ruff代码检查说明

feat: 新增AI助手相关API和前端组件

chore: 更新.gitignore文件,添加ruff缓存配置

fix: 修复前端布局和设置相关的问题

perf: 优化代码结构和性能,移除冗余代码

test: 更新测试文件,移除编码声明

build: 更新依赖版本,调整requirements.txt
2026-01-16 01:13:59 +08:00

29 lines
898 B
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, UserMixin
if TYPE_CHECKING:
from app.api.v1.module_system.user.model import UserModel
class PositionModel(ModelMixin, UserMixin):
"""
岗位模型
"""
__tablename__: str = "sys_position"
__table_args__: dict[str, str] = ({'comment': '岗位表'})
__loader_options__: list[str] = ["users", "created_by", "updated_by"]
name: 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"
)