mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
refactor: 优化代码注释和文档字符串格式
style: 统一代码风格和格式 docs: 完善函数和方法的文档字符串 refactor(base_model): 移除冗余的表名和表参数生成方法 refactor(constant): 更新返回码注释格式 refactor(router_class): 添加路由处理器的详细文档 refactor(database): 完善数据库连接函数的文档 refactor(security): 添加认证类和方法的详细文档 refactor(validator): 更新验证器函数的文档格式 refactor(serialize): 优化序列化工具类的文档 refactor(response): 完善响应类的文档字符串 refactor(dependencies): 添加依赖函数的详细文档 refactor(initialize): 完善初始化脚本的文档 refactor(plugin): 添加生命周期和中间件注册的文档 refactor(service): 完善服务层方法的文档 refactor(controller): 添加控制器方法的详细文档 refactor(crud): 完善CRUD操作的文档字符串 refactor(schema): 简化模型类并移除冗余字段 refactor(param): 更新查询参数类的注释格式 refactor(template): 优化代码生成模板的格式 refactor(console): 添加控制台输出功能的实现 refactor(util): 完善工具函数的文档字符串
This commit is contained in:
+55
-7
@@ -24,7 +24,12 @@ CacheRouter = APIRouter(route_class=OperationLogRoute, prefix="/cache", tags=["
|
||||
async def get_monitor_cache_info_controller(
|
||||
redis: Redis = Depends(redis_getter)
|
||||
) -> JSONResponse:
|
||||
"""获取缓存监控统计信息"""
|
||||
"""
|
||||
获取缓存监控统计信息
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含缓存监控统计信息的JSON响应
|
||||
"""
|
||||
result = await CacheService.get_cache_monitor_statistical_info_service(redis=redis)
|
||||
logger.info('获取缓存监控信息成功')
|
||||
return SuccessResponse(data=result, msg='获取缓存监控信息成功')
|
||||
@@ -37,7 +42,12 @@ async def get_monitor_cache_info_controller(
|
||||
description="获取缓存名称列表"
|
||||
)
|
||||
async def get_monitor_cache_name_controller() -> JSONResponse:
|
||||
"""获取缓存名称列表"""
|
||||
"""
|
||||
获取缓存名称列表
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含缓存名称列表的JSON响应
|
||||
"""
|
||||
result = await CacheService.get_cache_monitor_cache_name_service()
|
||||
logger.info('获取缓存名称列表成功')
|
||||
return SuccessResponse(data=result, msg='获取缓存名称列表成功')
|
||||
@@ -53,7 +63,15 @@ async def get_monitor_cache_key_controller(
|
||||
cache_name: str,
|
||||
redis: Redis = Depends(redis_getter)
|
||||
) -> JSONResponse:
|
||||
"""获取指定缓存名称下的键名列表"""
|
||||
"""
|
||||
获取指定缓存名称下的键名列表
|
||||
|
||||
参数:
|
||||
- cache_name (str): 缓存名称
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含缓存键名列表的JSON响应
|
||||
"""
|
||||
result = await CacheService.get_cache_monitor_cache_key_service(redis=redis, cache_name=cache_name)
|
||||
logger.info(f'获取缓存{cache_name}的键名列表成功')
|
||||
return SuccessResponse(data=result, msg=f'获取缓存{cache_name}的键名列表成功')
|
||||
@@ -70,7 +88,16 @@ async def get_monitor_cache_value_controller(
|
||||
cache_key: str,
|
||||
redis: Redis = Depends(redis_getter)
|
||||
)-> JSONResponse:
|
||||
"""获取指定缓存键的值"""
|
||||
"""
|
||||
获取指定缓存键的值
|
||||
|
||||
参数:
|
||||
- cache_name (str): 缓存名称
|
||||
- cache_key (str): 缓存键
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含缓存值的JSON响应
|
||||
"""
|
||||
result = await CacheService.get_cache_monitor_cache_value_service(redis=redis, cache_name=cache_name, cache_key=cache_key)
|
||||
logger.info(f'获取缓存{cache_name}:{cache_key}的值成功')
|
||||
return SuccessResponse(data=result, msg=f'获取缓存{cache_name}:{cache_key}的值成功')
|
||||
@@ -86,7 +113,15 @@ async def clear_monitor_cache_name_controller(
|
||||
cache_name: str,
|
||||
redis: Redis = Depends(redis_getter)
|
||||
) -> JSONResponse:
|
||||
"""清除指定缓存名称下的所有缓存"""
|
||||
"""
|
||||
清除指定缓存名称下的所有缓存
|
||||
|
||||
参数:
|
||||
- cache_name (str): 缓存名称
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含清除结果的JSON响应
|
||||
"""
|
||||
result = await CacheService.clear_cache_monitor_cache_name_service(redis=redis, cache_name=cache_name)
|
||||
if not result:
|
||||
raise CustomException(msg='清除缓存失败', data=result)
|
||||
@@ -104,7 +139,15 @@ async def clear_monitor_cache_key_controller(
|
||||
cache_key: str,
|
||||
redis: Redis = Depends(redis_getter)
|
||||
) -> JSONResponse:
|
||||
"""清除指定缓存键"""
|
||||
"""
|
||||
清除指定缓存键
|
||||
|
||||
参数:
|
||||
- cache_key (str): 缓存键
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含清除结果的JSON响应
|
||||
"""
|
||||
result = await CacheService.clear_cache_monitor_cache_key_service(redis=redis, cache_key=cache_key)
|
||||
if not result:
|
||||
raise CustomException(msg='清除缓存失败', data=result)
|
||||
@@ -121,7 +164,12 @@ async def clear_monitor_cache_key_controller(
|
||||
async def clear_monitor_cache_all_controller(
|
||||
redis: Redis = Depends(redis_getter)
|
||||
) -> JSONResponse:
|
||||
"""清除所有缓存"""
|
||||
"""
|
||||
清除所有缓存
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含清除结果的JSON响应
|
||||
"""
|
||||
result = await CacheService.clear_cache_monitor_all_service(redis=redis)
|
||||
if not result:
|
||||
raise CustomException(msg='清除缓存失败', data=result)
|
||||
|
||||
Reference in New Issue
Block a user