index.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import request from '@/utils/request';
  2. import { AxiosPromise } from 'axios';
  3. import { CacheVO } from './types';
  4. // 查询缓存详细
  5. export function getCache(): AxiosPromise<CacheVO> {
  6. return request({
  7. url: '/monitor/cache',
  8. method: 'get'
  9. });
  10. }
  11. // 查询缓存名称列表
  12. export function listCacheName() {
  13. return request({
  14. url: '/monitor/cache/getNames',
  15. method: 'get'
  16. });
  17. }
  18. // 查询缓存键名列表
  19. export function listCacheKey(cacheName: string) {
  20. return request({
  21. url: '/monitor/cache/getKeys/' + cacheName,
  22. method: 'get'
  23. });
  24. }
  25. // 查询缓存内容
  26. export function getCacheValue(cacheName: string, cacheKey: string) {
  27. return request({
  28. url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey,
  29. method: 'get'
  30. });
  31. }
  32. // 清理指定名称缓存
  33. export function clearCacheName(cacheName: string) {
  34. return request({
  35. url: '/monitor/cache/clearCacheName/' + cacheName,
  36. method: 'delete'
  37. });
  38. }
  39. // 清理指定键名缓存
  40. export function clearCacheKey(cacheName: string, cacheKey: string) {
  41. return request({
  42. url: '/monitor/cache/clearCacheKey/' + cacheName + '/' + cacheKey,
  43. method: 'delete'
  44. });
  45. }
  46. // 清理全部缓存
  47. export function clearCacheAll() {
  48. return request({
  49. url: '/monitor/cache/clearCacheAll',
  50. method: 'delete'
  51. });
  52. }