mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 13:05:18 +00:00
refactor: 优化代码结构和可读性 feat: 添加http_limit模块实现请求限制功能 fix: 修复异步任务中使用time.sleep的问题 chore: 更新依赖项并添加pytest测试框架 docs: 更新项目描述信息 perf: 优化Redis序列化方式使用JSON替代pickle test: 添加测试相关配置和依赖
25 lines
850 B
Python
25 lines
850 B
Python
from typing import Any
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class CacheMonitorSchema(BaseModel):
|
|
"""缓存监控信息模型"""
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
command_stats: list[dict] = Field(default_factory=list, description="Redis命令统计信息")
|
|
db_size: int = Field(default=0, description="Redis数据库中的Key总数")
|
|
info: dict = Field(default_factory=dict, description="Redis服务器信息")
|
|
|
|
|
|
class CacheInfoSchema(BaseModel):
|
|
"""缓存对象信息模型"""
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
cache_key: str = Field(..., description="缓存键名")
|
|
cache_name: str = Field(..., description="缓存名称")
|
|
cache_value: Any = Field(default=None, description="缓存值")
|
|
remark: str | None = Field(default=None, description="备注说明")
|