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