mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
refactor: 重构数据库连接模块,提高可维护性 docs: 更新README.md项目描述 style: 调整日志输出格式和内容 refactor: 优化中间件日志记录逻辑 style: 统一代码中的空行和导入顺序 refactor: 分离数据库引擎和会话创建逻辑 style: 清理未使用的导入和代码 refactor: 重命名数据库会话变量 style: 调整jinja2模板变量命名 refactor: 优化异常处理和日志记录 style: 统一字符串格式化方式 refactor: 优化redis连接错误处理 style: 调整注释格式和位置 refactor: 优化数据库连接配置 style: 清理多余空行和注释
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional
|
|
from fastapi import Query
|
|
|
|
from app.core.validator import DateTimeStr
|
|
|
|
|
|
class ParamsQueryParam:
|
|
"""配置管理查询参数"""
|
|
|
|
def __init__(
|
|
self,
|
|
config_name: Optional[str] = Query(None, description="配置名称"),
|
|
config_key: Optional[str] = Query(None, description="配置键名"),
|
|
config_type: Optional[bool] = Query(None, description="系统内置((True:是 False:否))"),
|
|
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2025-01-01 00:00:00"),
|
|
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2025-12-31 23:59:59"),
|
|
) -> None:
|
|
|
|
# 模糊查询字段
|
|
self.config_name = ("like", config_name)
|
|
self.config_key = ("like", config_key)
|
|
|
|
# 精确查询字段
|
|
self.config_type = config_type
|
|
|
|
# 时间范围查询
|
|
if start_time and end_time:
|
|
self.created_at = ("between", (start_time, end_time))
|
|
|
|
|