mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
refactor(api): 重构API路由及模块结构,清理废弃模型代码
- 修改alembic配置以使用异步数据库URI和更新Base类引用 - 新增数据库Schema优化脚本,统一字段长度,添加索引,规范外键策略 - 重构API路由管理,按模块类型分组并统一前缀 - 删除示例、监控及系统各子模块的模型定义,减少冗余代码 - 将mcp_server相关代码迁移到module_ai模块下,规范模块目录结构 - 迁移example控制器至module_application.application模块,并重命名相关服务和参数名 - 优化示例控制器中的依赖和响应结构,统一命名规范
This commit is contained in:
@@ -8,9 +8,9 @@ from sqlalchemy.engine import Result
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy import asc, func, select, delete, Select, desc, update, or_, and_
|
||||
|
||||
from app.api.v1.schemas.system.auth_schema import AuthSchema
|
||||
from app.api.v1.models.system.dept_model import DeptModel
|
||||
from app.api.v1.models.system.user_model import UserModel
|
||||
from app.api.v1.module_system.auth.schema import AuthSchema
|
||||
from app.api.v1.module_system.dept.model import DeptModel
|
||||
from app.api.v1.module_system.user.model import UserModel
|
||||
from app.utils.common_util import get_child_id_map, get_child_recursion
|
||||
from app.core.exceptions import CustomException
|
||||
|
||||
@@ -34,6 +34,7 @@ class CRUDBase(Generic[ModelType, CreateSchemaType, UpdateSchemaType]):
|
||||
self.auth = auth
|
||||
self.db: AsyncSession = auth.db
|
||||
self.current_user = auth.user
|
||||
|
||||
async def get(self, **kwargs) -> Optional[ModelType]:
|
||||
"""
|
||||
根据条件获取单个对象
|
||||
|
||||
Reference in New Issue
Block a user