mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 13:05:18 +00:00
- 将前端API路径从`system`和`monitor`重命名为`module_system`和`module_monitor` - 移除MongoDB相关配置和依赖 - 统一数据库类型命名为`mysql`和`postgres` - 修复代码生成模板中的字段命名问题 - 更新依赖项并移除不必要的包 - 优化数据库连接配置 - 添加新的文档和Redoc视图组件 - 修复SQL脚本中的字段注释
34 lines
1007 B
Python
34 lines
1007 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional
|
|
from fastapi import Query
|
|
|
|
|
|
class GenTableQueryParam:
|
|
"""代码生成业务表查询参数
|
|
- 支持按`table_name`、`table_comment`进行模糊检索(由CRUD层实现like)。
|
|
- 空值将被忽略,不参与过滤。
|
|
"""
|
|
|
|
def __init__(
|
|
self,
|
|
table_name: Optional[str] = Query(None, description="表名称"),
|
|
table_comment: Optional[str] = Query(None, description="表注释"),
|
|
) -> None:
|
|
# 模糊查询字段
|
|
self.table_name = table_name
|
|
self.table_comment = table_comment
|
|
|
|
|
|
class GenTableColumnQueryParam:
|
|
"""代码生成业务表字段查询参数
|
|
- `column_name`按like规则模糊查询(透传到CRUD层)
|
|
"""
|
|
|
|
def __init__(
|
|
self,
|
|
column_name: Optional[str] = Query(None, description="列名称"),
|
|
) -> None:
|
|
# 模糊查询字段:约定("like", 值)格式,便于CRUD解析
|
|
self.column_name = ("like", column_name)
|