mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-04 09:10:59 +00:00
- 修改alembic配置以使用异步数据库URI和更新Base类引用 - 新增数据库Schema优化脚本,统一字段长度,添加索引,规范外键策略 - 重构API路由管理,按模块类型分组并统一前缀 - 删除示例、监控及系统各子模块的模型定义,减少冗余代码 - 将mcp_server相关代码迁移到module_ai模块下,规范模块目录结构 - 迁移example控制器至module_application.application模块,并重命名相关服务和参数名 - 优化示例控制器中的依赖和响应结构,统一命名规范
30 lines
905 B
Python
30 lines
905 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="select")
|
|
|
|
# users: Mapped[List["UserModel"]] = relationship(secondary="system_user_positions", back_populates="positions", lazy="select")
|
|
|