测试接口调试
This commit is contained in:
26
pom.xml
26
pom.xml
@ -71,15 +71,25 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- LoadBalancer 支持 lb:// 协议 -->
|
<!-- LoadBalancer 支持 lb:// 协议 -->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>org.springframework.cloud</groupId>-->
|
||||||
|
<!-- <artifactId>spring-cloud-starter-loadbalancer</artifactId>-->
|
||||||
|
<!-- <exclusions>-->
|
||||||
|
<!-- <exclusion>-->
|
||||||
|
<!-- <groupId>org.springframework.cloud</groupId>-->
|
||||||
|
<!-- <artifactId>spring-cloud-commons</artifactId>-->
|
||||||
|
<!-- </exclusion>-->
|
||||||
|
<!-- </exclusions>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
<artifactId>caffeine</artifactId>
|
||||||
<exclusions>
|
</dependency>
|
||||||
<exclusion>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<dependency>
|
||||||
<artifactId>spring-cloud-commons</artifactId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
</exclusion>
|
<artifactId>spring-boot-starter-cache</artifactId>
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Actuator 监控 -->
|
<!-- Actuator 监控 -->
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.sczx.gateway.controller;
|
package com.sczx.gateway.controller;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cloud.client.ServiceInstance;
|
import org.springframework.cloud.client.ServiceInstance;
|
||||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||||
@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
public class TestController {
|
public class TestController {
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -29,7 +31,7 @@ public class TestController {
|
|||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
return "No instance chosen!";
|
return "No instance chosen!";
|
||||||
}
|
}
|
||||||
|
log.info("Chosen instance: {}", instance.getUri());
|
||||||
return "Chosen instance: " + instance.getUri();
|
return "Chosen instance: " + instance.getUri();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user