Files
FastapiAdmin/backend/app/api/v1/module_generator/table/model.py
T
zhangtao 3b04534b32 refactor(api): 重构API路由及模块结构,清理废弃模型代码
- 修改alembic配置以使用异步数据库URI和更新Base类引用
- 新增数据库Schema优化脚本,统一字段长度,添加索引,规范外键策略
- 重构API路由管理,按模块类型分组并统一前缀
- 删除示例、监控及系统各子模块的模型定义,减少冗余代码
- 将mcp_server相关代码迁移到module_ai模块下,规范模块目录结构
- 迁移example控制器至module_application.application模块,并重命名相关服务和参数名
- 优化示例控制器中的依赖和响应结构,统一命名规范
2025-09-04 02:50:29 +08:00

45 lines
1.7 KiB
Python

# -*- coding:utf-8 -*-
import datetime
from sqlalchemy import Boolean, Column, ForeignKey, String, Integer, Text, DateTime
from app.core.base_model import BaseMixin
class SysTable(BaseMixin):
__tablename__ = "gen_table"
id = Column(Integer, primary_key=True, autoincrement=True)
create_time = Column(DateTime, nullable=False, default=datetime.datetime.now, comment='创建时间')
update_time = Column(DateTime, nullable=False, default=datetime.datetime.now, onupdate=datetime.datetime.now, index=True, comment='更新时间')
del_flag = Column(String(1), nullable=False, default='0', server_default=text("'0'"), comment='删除标志(0代表存在 2代表删除)')
align = Column(String(255), nullable=False, default='left', comment='对其方式')
field_name = Column(String(255), nullable=False, comment='字段名')
fixed = Column(String(1), nullable=False, default='0', comment='固定表头')
label = Column(String(255), nullable=False, comment='字段标签')
label_tip = Column(String(255), comment='字段标签解释')
prop = Column(String(255), nullable=False, comment='驼峰属性')
show = Column(String(1), nullable=False, default='1', comment='可见')
sortable = Column(String(1), nullable=False, default='0', comment='可排序')
table_name = Column(String(255), nullable=False, comment='表名')
tooltip = Column(String(1), nullable=False, default='1', comment='超出隐藏')
update_by = Column(Integer, comment='更新者')
update_by_name = Column(String(255), comment='更新者')
width = Column(Integer, nullable=False, default=150, comment='宽度')
sequence = Column(Integer, nullable=False, default=0, comment='字段顺序')