新增缓存列表菜单功能

This commit is contained in:
RuoYi
2022-06-25 09:39:39 +08:00
parent abb88d622a
commit 9d7e32fb07
18 changed files with 522 additions and 69 deletions

View File

@ -0,0 +1,81 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.utils.StringUtils;
/**
* 缓存信息
*
* @author ruoyi
*/
public class SysCache
{
/** 缓存名称 */
private String cacheName = "";
/** 缓存键名 */
private String cacheKey = "";
/** 缓存内容 */
private String cacheValue = "";
/** 备注 */
private String remark = "";
public SysCache()
{
}
public SysCache(String cacheName, String remark)
{
this.cacheName = cacheName;
this.remark = remark;
}
public SysCache(String cacheName, String cacheKey, String cacheValue)
{
this.cacheName = StringUtils.replace(cacheName, ":", "");
this.cacheKey = StringUtils.replace(cacheKey, cacheName, "");
this.cacheValue = cacheValue;
}
public String getCacheName()
{
return cacheName;
}
public void setCacheName(String cacheName)
{
this.cacheName = cacheName;
}
public String getCacheKey()
{
return cacheKey;
}
public void setCacheKey(String cacheKey)
{
this.cacheKey = cacheKey;
}
public String getCacheValue()
{
return cacheValue;
}
public void setCacheValue(String cacheValue)
{
this.cacheValue = cacheValue;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
}

View File

@ -1,7 +1,12 @@
package com.ruoyi.system.service.impl;
import java.util.Collection;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
@ -11,11 +16,6 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Collection;
import java.util.List;
/**
* 参数配置 服务层实现
@ -181,7 +181,7 @@ public class SysConfigServiceImpl implements ISysConfigService
@Override
public void clearConfigCache()
{
Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
Collection<String> keys = redisCache.keys(CacheConstants.SYS_CONFIG_KEY + "*");
redisCache.deleteObject(keys);
}
@ -221,6 +221,6 @@ public class SysConfigServiceImpl implements ISysConfigService
*/
private String getCacheKey(String configKey)
{
return Constants.SYS_CONFIG_KEY + configKey;
return CacheConstants.SYS_CONFIG_KEY + configKey;
}
}