| | |
| | | import javax.annotation.PostConstruct;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.common.core.constant.Constants;
|
| | | import com.ruoyi.common.core.constant.CacheConstants;
|
| | | import com.ruoyi.common.core.constant.UserConstants;
|
| | | import com.ruoyi.common.core.exception.ServiceException;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | |
| | | @Override
|
| | | public int updateConfig(SysConfig config)
|
| | | {
|
| | | SysConfig temp = configMapper.selectConfigById(config.getConfigId());
|
| | | if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey()))
|
| | | {
|
| | | redisService.deleteObject(getCacheKey(temp.getConfigKey()));
|
| | | }
|
| | |
|
| | | int row = configMapper.updateConfig(config);
|
| | | if (row > 0)
|
| | | {
|
| | |
| | | @Override
|
| | | public void clearConfigCache()
|
| | | {
|
| | | Collection<String> keys = redisService.keys(Constants.SYS_CONFIG_KEY + "*");
|
| | | Collection<String> keys = redisService.keys(CacheConstants.SYS_CONFIG_KEY + "*");
|
| | | redisService.deleteObject(keys);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | private String getCacheKey(String configKey)
|
| | | {
|
| | | return Constants.SYS_CONFIG_KEY + configKey;
|
| | | return CacheConstants.SYS_CONFIG_KEY + configKey;
|
| | | }
|
| | | }
|