import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CacheRedisQuery, SysRedis } from '@/api/system/redisManage/types';

/**
 * 查询redis列表
 * @param query
 * @returns {*}
 */

export const getRedisList = (query?: CacheRedisQuery): AxiosPromise<SysRedis[]> => {
  return request({
    url: '/system/redis/cache/query',
    method: 'get',
    params: query
  });
};

/**
 * 删除redis数据
 * @returns {*}
 * @param date
 */

export const removeRedisList = (date?: SysRedis) => {
  return request({
    url: '/system/redis/cache/remove',
    method: 'post',
    data: date
  });
};

/**
 * 刷新缓存
 */
export const refreshCache = () => {
  return request({
    url: '/amnt/query/refreshCache',
    method: 'post'
  });
};
