Files
FastapiAdmin/backend/app/api/v1/module_system/position/model.py
T
zhangtao a42feeee30 refactor(工单/版本模块): 重构工单和版本模块代码结构
重构工单和版本模块的模型、服务层、控制器及CRUD操作
移除冗余代码,统一使用基础CRUD类实现
添加查询参数类用于工单和版本管理
优化模型字段定义和关系映射
2025-09-16 00:42:11 +08:00

29 lines
775 B
Python

# -*- coding: utf-8 -*-
"""
岗位模型模块
定义岗位相关数据模型
"""
from typing import List
from sqlalchemy import String, Integer
from sqlalchemy.orm import relationship, Mapped, mapped_column
from app.core.base_model import CreatorMixin
class PositionModel(CreatorMixin):
"""
岗位模型
"""
__tablename__ = "system_position"
__table_args__ = ({'comment': '岗位表'})
name: Mapped[str] = mapped_column(String(40), nullable=False, unique=True, comment="岗位名称")
order: Mapped[int] = mapped_column(Integer, nullable=False, default=1, comment="显示排序")
# 用户关联关系
users: Mapped[List["UserModel"]] = relationship(secondary="system_user_positions", back_populates="positions", lazy="selectin")