增加访问nacos的功能
This commit is contained in:
20
pom.xml
20
pom.xml
@ -13,8 +13,8 @@
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-boot.version>2.1.18.RELEASE</spring-boot.version>
|
||||
<spring-cloud.version>Greenwich.SR6</spring-cloud.version>
|
||||
<spring-boot.version>2.3.12.RELEASE</spring-boot.version>
|
||||
<spring-cloud.version>Hoxton.SR12</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2.2.9.RELEASE</spring-cloud-alibaba.version>
|
||||
</properties>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.1.18.RELEASE</version>
|
||||
<version>2.3.12.RELEASE</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
@ -70,10 +70,10 @@
|
||||
</dependency>
|
||||
|
||||
<!-- Nacos Service Discovery -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@ -145,6 +145,12 @@
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-core</artifactId>
|
||||
<version>3.2.2.RELEASE</version> <!-- 支持 Java 8 -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- Build Configuration -->
|
||||
|
||||
@ -4,6 +4,7 @@ import com.sczx.app.common.constant.SystemConstants;
|
||||
import com.sczx.app.utils.ComputerInfo;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import java.io.IOException;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient // 启用服务注册与发现
|
||||
@EnableRetry
|
||||
@EnableFeignClients(basePackages = SystemConstants.FEIGN_CLIENT_BASE_PACKAGE )
|
||||
@EnableTransactionManagement
|
||||
|
||||
@ -17,7 +17,11 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: localhost:8848 # Nacos 地址
|
||||
server-addr: 115.190.8.52:8848 # Nacos 地址
|
||||
group: DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0
|
||||
env: dev
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://115.190.8.52:3306/sczx?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||
@ -68,4 +72,3 @@ springdoc:
|
||||
url: /v3/api-docs
|
||||
path: /doc.html
|
||||
packages-to-scan: com.sczx.app.controller # 替换为你的 controller 包路径
|
||||
debug: true
|
||||
Reference in New Issue
Block a user