|
@@ -25,6 +25,8 @@ public class OpenApiConfig {
|
|
|
|
|
|
// @Value("${server.port}")
|
|
|
// private String mallPort;
|
|
|
+ @Value("${server.host}")
|
|
|
+ private String host;
|
|
|
@Resource
|
|
|
private DiscoveryClient discoveryClient;
|
|
|
@Bean
|
|
@@ -75,12 +77,12 @@ public class OpenApiConfig {
|
|
|
|
|
|
List<ServiceInstance> gateway = discoveryClient.getInstances("backstage");
|
|
|
|
|
|
- String gatewayUrl = "http://192.168.0.112:8401/mall";
|
|
|
+ String gatewayUrl = "";
|
|
|
if(!CollectionUtils.isEmpty(gateway)){
|
|
|
ServiceInstance serviceInstance = gateway.get(0);
|
|
|
|
|
|
String serviceId = serviceInstance.getServiceId();
|
|
|
- String host = serviceInstance.getHost();
|
|
|
+ // String host = serviceInstance.getHost();
|
|
|
int port = serviceInstance.getPort();
|
|
|
gatewayUrl = "http://"+host+":"+port+"/mall";
|
|
|
}
|