blob: d348d4b5fa36a3220132121d5d101e5868c3f6d7 [file] [log] [blame]
Jiarenxiang38dcb052025-03-13 16:40:09 +08001import { request } from '@umijs/max';
2
3/* *
4 *
5 * @author whiteshader@163.com
6 * @datetime 2022/06/27
7 *
8 * */
9
10
11// 查询缓存名称列表
12export function listCacheName() {
13 return request<API.Monitor.CacheNamesResponse>('/api/monitor/cache/getNames', {
14 method: 'get'
15 })
16}
17
18// 查询缓存键名列表
19export function listCacheKey(cacheName: string) {
20 return request<API.Monitor.CacheKeysResponse>('/api/monitor/cache/getKeys/' + cacheName, {
21 method: 'get'
22 })
23}
24
25// 查询缓存内容
26export function getCacheValue(cacheName: string, cacheKey: string) {
27 return request<API.Monitor.CacheValueResponse>('/api/monitor/cache/getValue/' + cacheName + '/' + cacheKey, {
28 method: 'get'
29 })
30}
31
32// 清理指定名称缓存
33export function clearCacheName(cacheName: string) {
34 return request<API.Result>('/api/monitor/cache/clearCacheName/' + cacheName, {
35 method: 'delete'
36 })
37}
38
39// 清理指定键名缓存
40export function clearCacheKey(cacheKey: string) {
41 return request<API.Result>('/api/monitor/cache/clearCacheKey/' + cacheKey, {
42 method: 'delete'
43 })
44}
45
46// 清理全部缓存
47export function clearCacheAll() {
48 return request<API.Result>('/api/monitor/cache/clearCacheAll', {
49 method: 'delete'
50 })
51}