diff --git a/src/main/java/com/ljc42/product/Controller/ProductController.java b/src/main/java/com/ljc42/product/Controller/ProductController.java index 8acc851..5f2b9d3 100644 --- a/src/main/java/com/ljc42/product/Controller/ProductController.java +++ b/src/main/java/com/ljc42/product/Controller/ProductController.java @@ -21,7 +21,7 @@ public class ProductController { private final ProductService productService; - @Value(value = "${product.service.welcome-message}") + @Value("${product.service.welcome-message}") private String welcomeMessage; public ProductController(ProductService productService) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ddc8b3c..61dc97b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -13,4 +13,5 @@ spring.redis.port=6379 rocketmq.name-server=localhost:9876 rocketmq.producer.group=my_producer_group -spring.config.import=nacos:nacosConfig.yaml \ No newline at end of file +spring.config.import[0]=nacos:demo.properties?group=DEFAULT_GROUP +spring.cloud.nacos.config.server-addr=127.0.0.1:8848 \ No newline at end of file diff --git a/src/main/resources/nacosConfig.yaml b/src/main/resources/nacosConfig.yaml deleted file mode 100644 index 7a62506..0000000 --- a/src/main/resources/nacosConfig.yaml +++ /dev/null @@ -1,7 +0,0 @@ -spring: - cloud: - nacos: - serverAddr: 10.10.2.71:8848 - config: - import: - - nacos:demo.properties?refreshEnabled=true \ No newline at end of file