mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-18 23:11:48 +08:00

* Attempt to serialize performance optimization * Add casbin service functions return type * update comments
24 lines
705 B
Python
24 lines
705 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from backend.app.common.jwt import DependsJwtAuth
|
|
from backend.app.common.permission import RequestPermission
|
|
from backend.app.common.response.response_schema import ResponseModel, response_base
|
|
from backend.app.utils.redis_info import redis_info
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get(
|
|
'/redis',
|
|
summary='redis 监控',
|
|
dependencies=[
|
|
Depends(RequestPermission('sys:monitor:redis')),
|
|
DependsJwtAuth,
|
|
],
|
|
)
|
|
async def get_redis_info() -> ResponseModel:
|
|
data = {'info': await redis_info.get_info(), 'stats': await redis_info.get_stats()}
|
|
return await response_base.success(data=data)
|