mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 21:06:32 +00:00
refactor(validator): 优化日期验证器并修复序列化问题 refactor(controller): 移除未使用的导入和接口 refactor(service): 优化类型提示和错误处理 fix(model): 修复JobLogModel字段定义 style(param): 移除未使用的导入和优化时间处理逻辑 fix(service): 修复服务器监控信息返回格式 fix(auth): 增强登录验证和错误处理 fix(dict): 修复字典数据状态更新逻辑 refactor(job): 优化任务服务和日志查询逻辑
22 lines
674 B
Python
22 lines
674 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional
|
|
from fastapi import Query
|
|
|
|
|
|
class OnlineQueryParam:
|
|
"""在线用户查询参数"""
|
|
|
|
def __init__(
|
|
self,
|
|
name: Optional[str] = Query(None, description="登录名称"),
|
|
ipaddr: Optional[str] = Query(None, description="登陆IP地址"),
|
|
login_location: Optional[str] = Query(None, description="登录所属地"),
|
|
) -> None:
|
|
|
|
# 模糊查询字段
|
|
self.name = ("like", f"%{name}%") if name else None
|
|
self.login_location = ("like", f"%{login_location}%") if login_location else None
|
|
self.ipaddr = ("like", f"%{ipaddr}%") if ipaddr else None
|
|
|