| | |
| | | |
| | | @Bean |
| | | public WxCpService wxCpService() { |
| | | // // 默认缓存配置 |
| | | // WxCpDefaultConfigImpl configStorage = new WxCpDefaultConfigImpl(); |
| | | |
| | | WxCpDefaultConfigImpl configStorage; |
| | | if (wxCpProperties.getConfigStorage().getType().equals(WxCpProperties.StorageType.redistemplate)) { |
| | | // redis缓存配置 |
| | | StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class); |
| | | configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix()); |
| | | } else if (wxCpProperties.getConfigStorage().getType().equals(WxCpProperties.StorageType.jedis)) { |
| | | // jedis配置 |
| | | WxCpRedisProperties wxCpRedisProperties = wxCpProperties.getConfigStorage().getRedis(); |
| | | JedisPool jedisPool; |
| | | if (wxCpRedisProperties != null && StringUtils.isNotEmpty(wxCpRedisProperties.getHost())) { |
| | |
| | | } |
| | | configStorage = new WxCpJedisConfigImpl(jedisPool, wxCpProperties.getConfigStorage().getKeyPrefix()); |
| | | } else { |
| | | // 默认配置 |
| | | // 默认缓存配置 |
| | | configStorage = new WxCpDefaultConfigImpl(); |
| | | } |
| | | |