mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 13:05:18 +00:00
重构代码生成模块的模板文件,统一命名规范为下划线风格 优化GenTableQueryParam查询参数类,移除不必要的字段 修复SQLite数据库支持问题,改进表结构查询逻辑 添加数据验证处理,防止空值导致的异常 改进批量生成代码时的错误处理和参数校验
31 lines
808 B
Python
31 lines
808 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional
|
|
from fastapi import Query
|
|
|
|
from app.core.validator import DateTimeStr
|
|
|
|
|
|
class GenTableQueryParam:
|
|
"""代码生成业务表查询参数"""
|
|
|
|
def __init__(
|
|
self,
|
|
table_name: Optional[str] = Query(None, description="表名称"),
|
|
table_comment: Optional[str] = Query(None, description="表注释"),
|
|
) -> None:
|
|
# 模糊查询字段
|
|
self.table_name = ("like", table_name)
|
|
self.table_comment = ("like", table_comment)
|
|
|
|
|
|
class GenTableColumnQueryParam:
|
|
"""代码生成业务表字段查询参数"""
|
|
|
|
def __init__(
|
|
self,
|
|
column_name: Optional[str] = Query(None, description="列名称"),
|
|
) -> None:
|
|
# 模糊查询字段
|
|
self.column_name = ("like", column_name)
|