mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 13:05:18 +00:00
- 更新了多个控制器文件中的函数命名,增加了 _controller 后缀 - 更新了多个服务文件中的函数命名,增加了 _service 后缀 - 统一了命名格式,提高了代码的可读性和可维护性
29 lines
916 B
Python
29 lines
916 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
|
|
from fastapi import APIRouter, Depends
|
|
from fastapi.responses import JSONResponse
|
|
|
|
from app.core.dependencies import AuthPermission
|
|
from app.core.logger import logger
|
|
from app.common.response import SuccessResponse
|
|
from app.api.v1.services.monitor.server_service import ServerService
|
|
from app.core.router_class import OperationLogRoute
|
|
|
|
|
|
router = APIRouter(route_class=OperationLogRoute)
|
|
|
|
|
|
@router.get(
|
|
'/info',
|
|
summary="查询服务器监控信息",
|
|
description="查询服务器监控信息",
|
|
dependencies=[Depends(AuthPermission(permissions=["monitor:server:query"]))]
|
|
)
|
|
async def get_monitor_server_info_controller() -> JSONResponse:
|
|
# 获取全量数据
|
|
result_dict = await ServerService.get_server_monitor_info_service()
|
|
logger.info('获取服务器监控信息成功')
|
|
|
|
return SuccessResponse(data=result_dict, msg='获取服务器监控信息成功')
|