123
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
package com.ruoyi.cai.manager;
|
||||
|
||||
import com.ruoyi.cai.constant.RedisConstant;
|
||||
import com.ruoyi.cai.constant.RedisHttpConstant;
|
||||
import com.ruoyi.cai.enums.SystemConfigEnum;
|
||||
import com.ruoyi.cai.enums.systemconfig.SystemCheckResp;
|
||||
import com.ruoyi.common.core.service.SensitiveService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.availability.AvailabilityChangeEvent;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -93,7 +92,7 @@ public class SystemConfigManager {
|
||||
* @return
|
||||
*/
|
||||
public String getSystemConfig(SystemConfigEnum systemConfig){
|
||||
String value = (String) redisTemplate.opsForHash().get(RedisConstant.SYSTEM_CONFIG, systemConfig.name());
|
||||
String value = (String) redisTemplate.opsForHash().get(RedisHttpConstant.SYSTEM_CONFIG, systemConfig.name());
|
||||
if(StringUtils.isBlank(value)){
|
||||
return systemConfig.getDefaultValue();
|
||||
}
|
||||
@@ -124,7 +123,7 @@ public class SystemConfigManager {
|
||||
*/
|
||||
public Map<String,String> getAllSystemConfig(){
|
||||
HashOperations<String, String, String> stringObjectObjectHashOperations = redisTemplate.opsForHash();
|
||||
return stringObjectObjectHashOperations.entries(RedisConstant.SYSTEM_CONFIG);
|
||||
return stringObjectObjectHashOperations.entries(RedisHttpConstant.SYSTEM_CONFIG);
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +142,6 @@ public class SystemConfigManager {
|
||||
if(key.equals(SystemConfigEnum.SENSITIVE_ENABLE.getKey())){
|
||||
sensitiveService.setSensitive(value.equals("1"));
|
||||
}
|
||||
redisTemplate.opsForHash().put(RedisConstant.SYSTEM_CONFIG, key,value);
|
||||
redisTemplate.opsForHash().put(RedisHttpConstant.SYSTEM_CONFIG, key,value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user