SpringCloudAlibaba + Nacos整合完成
This commit is contained in:
@@ -19,6 +19,10 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
|
@@ -23,6 +23,7 @@ public class BookController {
|
||||
|
||||
@RequestMapping("/book/{bid}")
|
||||
Book findBookById(@PathVariable("bid") int bid) {
|
||||
System.out.println("调用图书服务");
|
||||
return service.getBookById(bid);
|
||||
}
|
||||
}
|
||||
|
@@ -6,3 +6,11 @@ spring:
|
||||
url: jdbc:mysql://43.143.164.194:3306/mac
|
||||
username: mac
|
||||
password: mactest
|
||||
# 应用名称 bookservice
|
||||
application:
|
||||
name: bookservice
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 配置Nacos注册中心地址
|
||||
server-addr: localhost:8848
|
||||
|
Reference in New Issue
Block a user