Selaa lähdekoodia

:art:【微信开放平台】优化 Spring Boot Starter 配置逻辑

Forever杨 3 vuotta sitten
vanhempi
commit
b8f328b90b

+ 10 - 9
spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/storage/AbstractWxOpenConfigStorageConfiguration.java

@@ -9,19 +9,20 @@ import me.chanjar.weixin.open.api.impl.WxOpenInMemoryConfigStorage;
 public abstract class AbstractWxOpenConfigStorageConfiguration {
 
   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.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
-    config.setHttpProxyUsername(configStorageProperties.getHttpProxyUsername());
-    config.setHttpProxyPassword(configStorageProperties.getHttpProxyPassword());
-    if (configStorageProperties.getHttpProxyPort() != null) {
-      config.setHttpProxyPort(configStorageProperties.getHttpProxyPort());
+    config.setHttpProxyHost(storage.getHttpProxyHost());
+    config.setHttpProxyUsername(storage.getHttpProxyUsername());
+    config.setHttpProxyPassword(storage.getHttpProxyPassword());
+    Integer httpProxyPort = storage.getHttpProxyPort();
+    if (httpProxyPort != null) {
+      config.setHttpProxyPort(httpProxyPort);
     }
-    int maxRetryTimes = configStorageProperties.getMaxRetryTimes();
-    if (configStorageProperties.getMaxRetryTimes() < 0) {
+    int maxRetryTimes = storage.getMaxRetryTimes();
+    if (maxRetryTimes < 0) {
       maxRetryTimes = 0;
     }
-    int retrySleepMillis = configStorageProperties.getRetrySleepMillis();
+    int retrySleepMillis = storage.getRetrySleepMillis();
     if (retrySleepMillis < 0) {
       retrySleepMillis = 1000;
     }