| | |
| | | // // 默认缓存配置 |
| | | // WxCpDefaultConfigImpl configStorage = new WxCpDefaultConfigImpl(); |
| | | |
| | | // redis缓存配置 |
| | | StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class); |
| | | WxCpDefaultConfigImpl configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix()); |
| | | 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 { |
| | | // 默认配置 |
| | | configStorage = new WxCpDefaultConfigImpl(); |
| | | } |
| | | |
| | | // 基本配置 |
| | | configStorage.setCorpId(wxCpProperties.getCorpId()); |
| | | configStorage.setAgentId(wxCpProperties.getAgentId()); |
| | | configStorage.setCorpSecret(wxCpProperties.getCorpSecret()); |