|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
package com.chinaitop.agile;
|
|
2
|
2
|
|
|
|
3
|
+import org.springframework.beans.factory.annotation.Value;
|
|
3
|
4
|
import org.springframework.context.annotation.Bean;
|
|
4
|
5
|
import org.springframework.context.annotation.Configuration;
|
|
5
|
6
|
|
|
|
@@ -15,6 +16,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|
15
|
16
|
@EnableSwagger2
|
|
16
|
17
|
public class SwaggerAgileConfig {
|
|
17
|
18
|
|
|
|
19
|
+ @Value("${eureka.instance.hostname}")
|
|
|
20
|
+ private String eureka_ip;
|
|
|
21
|
+
|
|
18
|
22
|
@Bean
|
|
19
|
23
|
public Docket createRestApi() {
|
|
20
|
24
|
return new Docket(DocumentationType.SWAGGER_2)
|
|
|
@@ -25,10 +29,11 @@ public class SwaggerAgileConfig {
|
|
25
|
29
|
.build();
|
|
26
|
30
|
}
|
|
27
|
31
|
private ApiInfo apiInfo() {
|
|
|
32
|
+ String url = "http://"+eureka_ip+":9001";
|
|
28
|
33
|
return new ApiInfoBuilder()
|
|
29
|
34
|
.title("智能粮库管理平台api文档")
|
|
30
|
35
|
.description("出入库模块连接")
|
|
31
|
|
- .termsOfServiceUrl("http://localhost:9026")
|
|
|
36
|
+ .termsOfServiceUrl(url.trim())
|
|
32
|
37
|
.version("1.0")
|
|
33
|
38
|
.build();
|
|
34
|
39
|
}
|