|
@@ -1,10 +1,5 @@
|
|
|
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.CacheConstants;
|
|
|
import com.ruoyi.common.constant.UserConstants;
|
|
@@ -16,10 +11,16 @@ 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;
|
|
|
|
|
|
/**
|
|
|
* 参数配置 服务层实现
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
*/
|
|
|
@Service
|
|
@@ -42,7 +43,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 查询参数配置信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param configId 参数配置ID
|
|
|
* @return 参数配置信息
|
|
|
*/
|
|
@@ -57,7 +58,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 根据键名查询参数配置信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param configKey 参数key
|
|
|
* @return 参数键值
|
|
|
*/
|
|
@@ -82,7 +83,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 获取验证码开关
|
|
|
- *
|
|
|
+ *
|
|
|
* @return true开启,false关闭
|
|
|
*/
|
|
|
@Override
|
|
@@ -98,7 +99,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 查询参数配置列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param config 参数配置信息
|
|
|
* @return 参数配置集合
|
|
|
*/
|
|
@@ -110,7 +111,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 新增参数配置
|
|
|
- *
|
|
|
+ *
|
|
|
* @param config 参数配置信息
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -127,7 +128,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 修改参数配置
|
|
|
- *
|
|
|
+ *
|
|
|
* @param config 参数配置信息
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -150,7 +151,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 批量删除参数信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param configIds 需要删除的参数ID
|
|
|
*/
|
|
|
@Override
|
|
@@ -172,11 +173,13 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
* 加载参数缓存数据
|
|
|
*/
|
|
|
@Override
|
|
|
- public void loadingConfigCache()
|
|
|
- {
|
|
|
+ public void loadingConfigCache() {
|
|
|
List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
|
|
|
- for (SysConfig config : configsList)
|
|
|
- {
|
|
|
+ for (SysConfig config : configsList) {
|
|
|
+ if (StringUtils.isNotNull(config.getCfgJson())) {
|
|
|
+ redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getCfgJson());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
|
|
}
|
|
|
}
|
|
@@ -203,7 +206,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 校验参数键名是否唯一
|
|
|
- *
|
|
|
+ *
|
|
|
* @param config 参数配置信息
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -221,7 +224,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|
|
|
|
|
/**
|
|
|
* 设置cache key
|
|
|
- *
|
|
|
+ *
|
|
|
* @param configKey 参数键
|
|
|
* @return 缓存键key
|
|
|
*/
|