mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 21:06:32 +00:00
- 添加生产环境相关配置文件(.env.prod, .env.production, docker-compose.prod.yaml)到.gitignore - 更新前后端生产环境配置,包括数据库、Redis等连接信息 - 重构在线用户监控页面,优化查询逻辑和分页处理 - 调整路由配置,将个人中心路由移至根路由下 - 修改接口参数处理,将IP地址查询改为模糊查询
24 lines
727 B
Python
24 lines
727 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional
|
|
from fastapi import Query
|
|
|
|
|
|
class OnlineQueryParams:
|
|
"""在线用户查询参数"""
|
|
|
|
def __init__(
|
|
self,
|
|
name: Optional[str] = Query(None, description="登录名称"),
|
|
ipaddr: Optional[str] = Query(None, description="登陆IP地址"),
|
|
login_location: Optional[str] = Query(None, description="登录所属地"),
|
|
) -> None:
|
|
super().__init__()
|
|
|
|
# 模糊查询字段
|
|
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
|
|
|
|
|