fanxw 2 年 前
コミット
2371a3563a
共有2 個のファイルを変更した13 個の追加59 個の削除を含む
  1. 6 1
      src/main/java/com/chinaitop/depot/SwaggerConfig.java
  2. 7 58
      src/main/resources/bootstrap.yml

+ 6 - 1
src/main/java/com/chinaitop/depot/SwaggerConfig.java

@@ -1,5 +1,6 @@
1 1
 package com.chinaitop.depot;
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 SwaggerConfig {
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 SwaggerConfig {
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://192.168.80.25:9001")
36
+                .termsOfServiceUrl(url.trim())
32 37
                 .version("1.0")
33 38
                 .build();
34 39
     }

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

@@ -1,7 +1,3 @@
1
-spring:
2
-  profiles:
3
-    active: agentLv
4
----
5 1
 server:
6 2
   port: 9027
7 3
   tomcat:
@@ -13,11 +9,13 @@ eureka:
13 9
     service-url:
14 10
       defaultZone: http://172.16.0.4:9711/eureka/
15 11
   instance:
12
+    hostname: 172.16.0.16
16 13
     prefer-ip-address: true
17 14
     # 每隔10s发送一次心跳(默认30s)
18 15
     lease-renewal-interval-in-seconds: 10
19 16
     # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
20 17
     lease-expiration-duration-in-seconds: 30
18
+    status-page-url: http://${eureka.instance.hostname}:${server.port}/swagger-ui.html
21 19
 
22 20
 mybatis:
23 21
   config-location: classpath:mybatis/mybatis-config.xml
@@ -37,9 +35,9 @@ spring:
37 35
   session:
38 36
     store-type: redis
39 37
   redis:
40
-    database: 4
41
-    host: 172.16.0.46
42
-    port: 6679
38
+    database: 3
39
+    host: 172.16.0.2
40
+    port: 6379
43 41
     password: 123456
44 42
     timeout: 3000
45 43
     jedis:
@@ -53,58 +51,9 @@ spring:
53 51
     static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
54 52
 
55 53
 web:
56
-  upload-path: /upload
54
+  upload-path: /home/depot/depot-web/apache-tomcat-8.0.53/webapps/ROOT/WEB-INF/classes/static
57 55
 
58 56
 cxf:
59 57
   path: /archive
60
----
61
-server:
62
-  port: 9027
63
-  tomcat:
64
-    uri-encoding: utf-8
65
-
66
-# 注册中心配置
67
-eureka:
68
-  client:
69
-    service-url:
70
-      defaultZone: http://192.168.123.98:9002/eureka/
71
-  instance:
72
-    prefer-ip-address: true
73
-    # 每隔10s发送一次心跳(默认30s)
74
-    lease-renewal-interval-in-seconds: 10
75
-    # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
76
-    lease-expiration-duration-in-seconds: 30
77 58
 
78
-spring:
79
-  profiles: dev
80
-  application:
81
-    name: depot-agent-lv
82
-  # 数据库配置
83
-  datasource:
84
-    type: com.alibaba.druid.pool.DruidDataSource
85
-    url: jdbc:gbasedbt-sqli://192.168.123.38:9099/depot:INFORMIXSERVER=depot;NEWCODESET=GBK,8859-1,819;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;DB_LOCALE=zh_cn.GB18030-2000
86
-    username: gbasedbt
87
-    password: depot123456
88
-    driver-class-name: com.gbasedbt.jdbc.IfxDriver
89
-  # 缓存配置
90
-  session:
91
-    store-type: redis
92
-  redis:
93
-    database: 2
94
-    host: 192.168.123.98
95
-    port: 6666
96
-    password: depotredis
97
-    timeout: 3000
98
-    jedis:
99
-      pool:
100
-        max-active: 8
101
-        max-wait: -1
102
-        max-idle: 8
103
-        min-idle: 0
104
-  # 静态资源配置
105
-  resources:
106
-    static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
107
-
108
-web:
109
-  upload-path: /upload
110
-logging.level.com.chinaitop.depot.agent.crk.mapper: debug
59
+#logging.level.com.chinaitop.depot.agent.crk.mapper: debug