| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.assess.common.constant.CacheConstant; |
| | | import com.gkhy.assess.common.utils.RedisUtils; |
| | | import com.gkhy.assess.common.utils.StringUtils; |
| | | import com.gkhy.assess.system.domain.SysConfig; |
| | | import com.gkhy.assess.system.mapper.SysConfigMapper; |
| | | import com.gkhy.assess.system.service.SysConfigService; |
| | |
| | | public String getConfigByKey(String configKey) { |
| | | String redisKey=getCacheKey(configKey); |
| | | String configValue= (String) redisUtils.get(redisKey); |
| | | if(StrUtil.isNotEmpty(configValue)){ |
| | | if(StringUtils.isNotEmpty(configValue)){ |
| | | return configValue; |
| | | } |
| | | SysConfig retConfig=baseMapper.getConfig(new SysConfig().setConfigKey(configKey)); |
| | |
| | | redisUtils.set(redisKey,retConfig.getConfigValue()); |
| | | return retConfig.getConfigValue(); |
| | | } |
| | | return StrUtil.EMPTY; |
| | | return StringUtils.EMPTY; |
| | | } |
| | | |
| | | private String getCacheName(){ |