| | |
| | | private WxCpProperties properties; |
| | | |
| | | @Bean |
| | | @ConditionalOnMissingBean |
| | | @ConditionalOnMissingBean(name = "wxService") |
| | | public WxCpService wxService() { |
| | | |
| | | WxCpDefaultConfigImpl wxCpConfigStorage = new WxCpDefaultConfigImpl(); |
| | | wxCpConfigStorage.setCorpId(properties.getCorpId()); |
| | | wxCpConfigStorage.setAgentId(properties.getAgentId()); |
| | |
| | | return wxService; |
| | | } |
| | | |
| | | @Bean |
| | | @ConditionalOnMissingBean(name = "adWxService") |
| | | public WxCpService adWxService() { |
| | | WxCpDefaultConfigImpl wxAdCpConfigStorage = new WxCpDefaultConfigImpl(); |
| | | wxAdCpConfigStorage.setCorpId(properties.getCorpId()); |
| | | wxAdCpConfigStorage.setAgentId(properties.getAgentId()); |
| | | wxAdCpConfigStorage.setCorpSecret(properties.getAddressSecret()); |
| | | wxAdCpConfigStorage.setAesKey(properties.getEncodingAESKey()); |
| | | wxAdCpConfigStorage.setToken(properties.getToken()); |
| | | WxCpService adWxService = new WxCpServiceImpl(); |
| | | adWxService.setWxCpConfigStorage(wxAdCpConfigStorage); |
| | | return adWxService; |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | @ConditionalOnMissingBean |