diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java index 25a004776..a90d27668 100644 --- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java +++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java @@ -4,6 +4,7 @@ import com.binarywang.spring.starter.wxjava.miniapp.enums.HttpClientType; import com.binarywang.spring.starter.wxjava.miniapp.enums.StorageType; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * 属性配置类. @@ -60,6 +61,7 @@ public class WxMaProperties { /** * redis连接配置. */ + @NestedConfigurationProperty private final RedisProperties redis = new RedisProperties(); /** diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/config/WxMpStorageAutoConfiguration.java b/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/config/WxMpStorageAutoConfiguration.java index a814f73a8..c47272714 100644 --- a/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/config/WxMpStorageAutoConfiguration.java +++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/config/WxMpStorageAutoConfiguration.java @@ -137,8 +137,7 @@ public class WxMpStorageAutoConfiguration { } private JedisPoolAbstract getJedisPool() { - WxMpProperties.ConfigStorage storage = wxMpProperties.getConfigStorage(); - RedisProperties redis = storage.getRedis(); + RedisProperties redis = wxMpProperties.getConfigStorage().getRedis(); JedisPoolConfig config = new JedisPoolConfig(); if (redis.getMaxActive() != null) { diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/properties/WxMpProperties.java b/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/properties/WxMpProperties.java index 2e3abe223..3d3518bfd 100644 --- a/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/properties/WxMpProperties.java +++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/mp/properties/WxMpProperties.java @@ -4,6 +4,7 @@ import com.binarywang.spring.starter.wxjava.mp.enums.HttpClientType; import com.binarywang.spring.starter.wxjava.mp.enums.StorageType; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; import java.io.Serializable; @@ -49,7 +50,7 @@ public class WxMpProperties { /** * 存储策略 */ - private ConfigStorage configStorage = new ConfigStorage(); + private final ConfigStorage configStorage = new ConfigStorage(); @Data public static class ConfigStorage implements Serializable { @@ -68,7 +69,8 @@ public class WxMpProperties { /** * redis连接配置. */ - private RedisProperties redis = new RedisProperties(); + @NestedConfigurationProperty + private final RedisProperties redis = new RedisProperties(); /** * http客户端类型.