mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 05:02:57 +00:00
refactor(api): 重构API路由及模块结构,清理废弃模型代码
- 修改alembic配置以使用异步数据库URI和更新Base类引用 - 新增数据库Schema优化脚本,统一字段长度,添加索引,规范外键策略 - 重构API路由管理,按模块类型分组并统一前缀 - 删除示例、监控及系统各子模块的模型定义,减少冗余代码 - 将mcp_server相关代码迁移到module_ai模块下,规范模块目录结构 - 迁移example控制器至module_application.application模块,并重命名相关服务和参数名 - 优化示例控制器中的依赖和响应结构,统一命名规范
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from typing import Optional
|
||||
from sqlalchemy import String
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.core.base_model import CreatorMixin
|
||||
|
||||
|
||||
class DemoModel(CreatorMixin):
|
||||
"""
|
||||
示例表 - SQLAlchemy 2.0 语法
|
||||
兼容 MySQL 和 PostgreSQL
|
||||
"""
|
||||
__tablename__ = 'example_demo'
|
||||
__table_args__ = ({'comment': '示例表'})
|
||||
|
||||
name: Mapped[Optional[str]] = mapped_column(String(64), nullable=True, default='', comment='名称')
|
||||
Reference in New Issue
Block a user