fix:升级服务调整逻辑,完善通知配置初始化逻辑,回调待优化
This commit is contained in:
+17
-22
@@ -28,36 +28,31 @@ public class WechatAutoConfiguration {
|
||||
@ConditionalOnBean(WechatConfigService.class)
|
||||
public WxMpService wxMpService(WechatConfigService configService) {
|
||||
log.info("WxMpService(公众号相关)被加载,tenantId:{}", getCurrentTenantId());
|
||||
return new WxMpServiceImpl() {
|
||||
@Override
|
||||
public WxMpDefaultConfigImpl getWxMpConfigStorage() {
|
||||
WechatConfig config = configService.getConfig("MP", getCurrentTenantId());
|
||||
WxMpDefaultConfigImpl wxConfig = new WxMpDefaultConfigImpl();
|
||||
wxConfig.setAppId(config.getAppId());
|
||||
wxConfig.setSecret(config.getAppSecret());
|
||||
wxConfig.setToken(config.getToken());
|
||||
wxConfig.setAesKey(config.getAesKey());
|
||||
return wxConfig;
|
||||
}
|
||||
};
|
||||
WechatConfig wechatConfig = configService.getConfig("MP", getCurrentTenantId());
|
||||
WxMpService service = new WxMpServiceImpl();
|
||||
WxMpDefaultConfigImpl config = new WxMpDefaultConfigImpl();
|
||||
|
||||
config.setAppId(wechatConfig.getAppId());
|
||||
config.setSecret(wechatConfig.getAppSecret());
|
||||
|
||||
service.setWxMpConfigStorage(config);
|
||||
return service;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(WechatConfigService.class)
|
||||
public WxMaService wxMaService(WechatConfigService configService) {
|
||||
log.info("WxMaService(小程序通知)被加载,tenantId:{}", getCurrentTenantId());
|
||||
return new WxMaServiceImpl() {
|
||||
@Override
|
||||
public WxMaDefaultConfigImpl getWxMaConfig() {
|
||||
WechatConfig config = configService.getConfig("PAY", getCurrentTenantId());
|
||||
WxMaDefaultConfigImpl wxConfig = new WxMaDefaultConfigImpl();
|
||||
wxConfig.setAppid(config.getAppId());
|
||||
wxConfig.setSecret(config.getAppSecret());
|
||||
return wxConfig;
|
||||
}
|
||||
};
|
||||
WechatConfig wechatConfig = configService.getConfig("PAY", getCurrentTenantId());
|
||||
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
|
||||
config.setAppid(wechatConfig.getAppId());
|
||||
config.setSecret(wechatConfig.getAppSecret());
|
||||
WxMaService service = new WxMaServiceImpl();
|
||||
service.setWxMaConfig(config);
|
||||
return service;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean({WechatConfigService.class})
|
||||
public WxPayConfigFactory wxPayConfigFactory() {
|
||||
|
||||
Reference in New Issue
Block a user