36 lines
779 B
TypeScript
36 lines
779 B
TypeScript
/**
|
|
* @description 缓存监控相关接口
|
|
* @Link https://github.com/xiujiecn/xiu-admin
|
|
* @Copyright Copyright (c) 2025 LiXiujie
|
|
* @Author Lxj <xxx@example.com>
|
|
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
|
* @date 2024-03-21
|
|
*/
|
|
|
|
import { requestClient } from '#/api/request';
|
|
|
|
export interface CommandStats {
|
|
name: string;
|
|
value: string;
|
|
}
|
|
|
|
export interface RedisInfo {
|
|
[key: string]: string;
|
|
}
|
|
|
|
export interface CacheInfo {
|
|
commandStats: CommandStats[];
|
|
dbSize: number;
|
|
info: RedisInfo;
|
|
}
|
|
|
|
export async function redisCacheInfo() {
|
|
return requestClient.get<CacheInfo>('/monitor/cache');
|
|
}
|
|
|
|
export async function rebuildMemoryCache() {
|
|
return requestClient.post<{ tables: number }>(
|
|
'/monitor/cache/memory/rebuild',
|
|
);
|
|
}
|