fanxw 2 роки тому
батько
коміт
5337ef15cb

+ 9 - 1
src/main/java/com/chinaitop/SwaggerConfig.java

@@ -1,5 +1,6 @@
1 1
 package com.chinaitop;
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,12 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
15 16
 @EnableSwagger2
16 17
 public class SwaggerConfig {
17 18
 
19
+	@Value("${eureka.instance.hostname}")
20
+	private String eureka_id;
21
+	
22
+	@Value("${server.port}")
23
+	private String server_port;
24
+
18 25
     @Bean
19 26
     public Docket createRestApi() {
20 27
         return new Docket(DocumentationType.SWAGGER_2)
@@ -25,10 +32,11 @@ public class SwaggerConfig {
25 32
                 .build();
26 33
     }
27 34
     private ApiInfo apiInfo() {
35
+    	String url = "http://"+eureka_id+":"+server_port;
28 36
         return new ApiInfoBuilder()
29 37
                 .title("智能粮库管理平台api文档")
30 38
                 .description("基础数据")
31
-                .termsOfServiceUrl("http://localhost:9001")
39
+                .termsOfServiceUrl(url.trim())
32 40
                 .version("1.0")
33 41
                 .build();
34 42
     }

+ 1 - 1
src/main/java/com/chinaitop/utils/GeneratorSqlmap.java

@@ -16,7 +16,7 @@ public class GeneratorSqlmap {
16 16
 		List<String> warnings = new ArrayList<String>();
17 17
 		boolean overwrite = true;
18 18
 		//指定 逆向工程配置文件(写自己电脑的路径)
19
-		File configFile = new File("D:\\git_ziguangyun_gogs\\tianjin\\depot-basic-tianjin\\src\\main\\resources\\generatorConfig.xml");
19
+		File configFile = new File("D:\\gogs_local\\tianjin\\depot-basic-tianjin\\src\\main\\resources\\generatorConfig.xml");
20 20
 		ConfigurationParser cp = new ConfigurationParser(warnings);
21 21
 		Configuration config = cp.parseConfiguration(configFile);
22 22
 		DefaultShellCallback callback = new DefaultShellCallback(overwrite);

+ 7 - 6
src/main/resources/bootstrap.yml

@@ -11,12 +11,13 @@ eureka:
11 11
     #register-with-eureka: false
12 12
     #fetchRegistry: false
13 13
   instance:
14
+    hostname: 172.16.0.16
14 15
     #prefer-ip-address: true
15 16
     # 每隔10s发送一次心跳(默认30s)
16 17
     lease-renewal-interval-in-seconds: 10
17 18
     # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
18 19
     lease-expiration-duration-in-seconds: 30
19
-    status-page-url: http://localhost:9022/swagger-ui.html
20
+    status-page-url: http://172.16.0.16:9022/swagger-ui.html
20 21
 
21 22
 mybatis:
22 23
   config-location: classpath:mybatis/mybatis-config.xml
@@ -39,12 +40,12 @@ spring:
39 40
     store-type: redis
40 41
   redis:
41 42
     database: 3
42
-    #host: 172.16.0.2
43
-    #port: 6379
44
-    #password: 123456
45
-    host: localhost
43
+    host: 172.16.0.2
46 44
     port: 6379
47
-    password: 
45
+    password: 123456
46
+    #host: localhost
47
+    #port: 6379
48
+    #password: 
48 49
     timeout: 60000
49 50
     jedis:
50 51
       pool: