注册服务service-map和service-price

main
topsun 2 years ago
parent 68ed974927
commit 09214dcaa6

@ -15,5 +15,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -2,8 +2,10 @@ package com.taxi.serviceprice;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication @SpringBootApplication
@EnableDiscoveryClient//服务发现
public class ServicePriceApplication { public class ServicePriceApplication {
public static void main(String[] args) { public static void main(String[] args) {

@ -1,2 +1,10 @@
server: server:
port: 8084 port: 8084
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: servcie-price

@ -1,2 +1,10 @@
server: server:
port: 8084 port: 8084
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: servcie-price

@ -16,6 +16,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -3,10 +3,12 @@ package com.taxi.servicemap;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
@SpringBootApplication @SpringBootApplication
@EnableDiscoveryClient//服务发现
public class ServiceMapApplication { public class ServiceMapApplication {
public static void main(String[] args) { public static void main(String[] args) {

@ -1,5 +1,13 @@
server: server:
port: 8085 port: 8085
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: service-map
amap: amap:
key: 01d85ea8f7db65efc370cfec18ff6397 key: 01d85ea8f7db65efc370cfec18ff6397

@ -1,5 +1,13 @@
server: server:
port: 8085 port: 8085
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: service-map
amap: amap:
key: 01d85ea8f7db65efc370cfec18ff6397 key: 01d85ea8f7db65efc370cfec18ff6397
Loading…
Cancel
Save