| | |
| | | import com.iailab.module.infra.enums.config.ConfigTypeEnum; |
| | | import com.google.common.annotations.VisibleForTesting; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | import static com.iailab.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static com.iailab.module.infra.enums.ErrorCodeConstants.*; |
| | |
| | | |
| | | @Resource |
| | | private ConfigMapper configMapper; |
| | | |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @Override |
| | | public Long createConfig(ConfigSaveReqVO createReqVO) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getValue(String configCode) { |
| | | String paramValue = stringRedisTemplate.opsForValue().get(configCode); |
| | | if(paramValue == null){ |
| | | ConfigDO configDO = configMapper.selectByKey(configCode); |
| | | paramValue = configDO.getValue(); |
| | | stringRedisTemplate.opsForValue().set(configCode, paramValue); |
| | | } |
| | | return paramValue; |
| | | } |
| | | |
| | | } |