|
@@ -21,7 +21,6 @@ import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.nacos.api.PropertyKeyConst; |
|
|
import com.alibaba.nacos.api.PropertyKeyConst; |
|
|
import com.alibaba.nacos.api.config.ConfigFactory; |
|
|
import com.alibaba.nacos.api.config.ConfigFactory; |
|
|
import com.alibaba.nacos.api.config.ConfigService; |
|
|
import com.alibaba.nacos.api.config.ConfigService; |
|
|
import com.alibaba.nacos.api.config.annotation.NacosConfigurationProperties; |
|
|
|
|
|
import com.alibaba.nacos.api.exception.NacosException; |
|
|
import com.alibaba.nacos.api.exception.NacosException; |
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|
|
import org.springframework.context.annotation.Bean; |
|
|
import org.springframework.context.annotation.Bean; |
|
@@ -45,10 +44,10 @@ public class NacosConfiguration { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean |
|
|
@Bean |
|
|
public ConfigService nacosConfiguration(NacosProperties nacosPropertiesConfiguration) throws NacosException { |
|
|
|
|
|
|
|
|
public ConfigService nacosConfiguration(NacosProperties nacosProperties) throws NacosException { |
|
|
Properties properties = new Properties(); |
|
|
Properties properties = new Properties(); |
|
|
properties.put(PropertyKeyConst.SERVER_ADDR,nacosPropertiesConfiguration.getServerAddr()); |
|
|
|
|
|
properties.put(PropertyKeyConst.NAMESPACE,nacosPropertiesConfiguration.getNamespace()); |
|
|
|
|
|
|
|
|
properties.put(PropertyKeyConst.SERVER_ADDR,nacosProperties.getServerAddr()); |
|
|
|
|
|
properties.put(PropertyKeyConst.NAMESPACE,nacosProperties.getNamespace()); |
|
|
return ConfigFactory.createConfigService(properties); |
|
|
return ConfigFactory.createConfigService(properties); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|