注册服务service-map和service-price

main
topsun 2 years ago
parent 68ed974927
commit 09214dcaa6

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

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

@ -1,2 +1,10 @@
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:
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>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies>
</project>

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

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

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