mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-27 11:53:48 +08:00
🎨【微信开放平台】优化 Spring Boot Starter 配置逻辑
This commit is contained in:
@ -9,19 +9,20 @@ import me.chanjar.weixin.open.api.impl.WxOpenInMemoryConfigStorage;
|
|||||||
public abstract class AbstractWxOpenConfigStorageConfiguration {
|
public abstract class AbstractWxOpenConfigStorageConfiguration {
|
||||||
|
|
||||||
protected WxOpenInMemoryConfigStorage config(WxOpenInMemoryConfigStorage config, WxOpenProperties properties) {
|
protected WxOpenInMemoryConfigStorage config(WxOpenInMemoryConfigStorage config, WxOpenProperties properties) {
|
||||||
WxOpenProperties.ConfigStorage configStorageProperties = properties.getConfigStorage();
|
WxOpenProperties.ConfigStorage storage = properties.getConfigStorage();
|
||||||
config.setWxOpenInfo(properties.getAppId(), properties.getSecret(), properties.getToken(), properties.getAesKey());
|
config.setWxOpenInfo(properties.getAppId(), properties.getSecret(), properties.getToken(), properties.getAesKey());
|
||||||
config.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
|
config.setHttpProxyHost(storage.getHttpProxyHost());
|
||||||
config.setHttpProxyUsername(configStorageProperties.getHttpProxyUsername());
|
config.setHttpProxyUsername(storage.getHttpProxyUsername());
|
||||||
config.setHttpProxyPassword(configStorageProperties.getHttpProxyPassword());
|
config.setHttpProxyPassword(storage.getHttpProxyPassword());
|
||||||
if (configStorageProperties.getHttpProxyPort() != null) {
|
Integer httpProxyPort = storage.getHttpProxyPort();
|
||||||
config.setHttpProxyPort(configStorageProperties.getHttpProxyPort());
|
if (httpProxyPort != null) {
|
||||||
|
config.setHttpProxyPort(httpProxyPort);
|
||||||
}
|
}
|
||||||
int maxRetryTimes = configStorageProperties.getMaxRetryTimes();
|
int maxRetryTimes = storage.getMaxRetryTimes();
|
||||||
if (configStorageProperties.getMaxRetryTimes() < 0) {
|
if (maxRetryTimes < 0) {
|
||||||
maxRetryTimes = 0;
|
maxRetryTimes = 0;
|
||||||
}
|
}
|
||||||
int retrySleepMillis = configStorageProperties.getRetrySleepMillis();
|
int retrySleepMillis = storage.getRetrySleepMillis();
|
||||||
if (retrySleepMillis < 0) {
|
if (retrySleepMillis < 0) {
|
||||||
retrySleepMillis = 1000;
|
retrySleepMillis = 1000;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user