Ver código fonte

swaggeer控制

fanxw 1 ano atrás
pai
commit
e3a47b7d18

+ 2 - 0
src/main/java/com/chinaitop/depot/SwaggerConfig.java

@@ -1,6 +1,7 @@
1 1
 package com.chinaitop.depot;
2 2
 
3 3
 import org.springframework.beans.factory.annotation.Value;
4
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
4 5
 import org.springframework.context.annotation.Bean;
5 6
 import org.springframework.context.annotation.Configuration;
6 7
 
@@ -14,6 +15,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
14 15
 
15 16
 @Configuration
16 17
 @EnableSwagger2
18
+@ConditionalOnProperty(name = "swagger.enable", havingValue = "true")
17 19
 public class SwaggerConfig {
18 20
 	
19 21
 	@Value("${eureka.instance.hostname}")

+ 4 - 2
src/main/resources/application.properties

@@ -13,6 +13,8 @@ eureka.instance.status-page-url=http://${eureka.instance.hostname}:${server.port
13 13
 #eureka.instance.status-page-url=http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/swagger-ui.html
14 14
 
15 15
 management.server.port=-1
16
+#是否开启swaggeer? true开启,false关闭,生产环境要求关闭
17
+swagger.enable=true
16 18
 #management.endpoints.enabled-by-default=false
17 19
 
18 20
 #spring.security.basic.enabled=true
@@ -57,7 +59,7 @@ spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/reso
57 59
 #设置全局变量判断是云端还是库端;1云端,2本地
58 60
 localOrCloud=1
59 61
 #设置出入库连接
60
-forTheConnection=http://101.36.160.210:9905/Base/Main.action
62
+forTheConnection=http://200.2.68.126:9025/Base/Main.action
61 63
 #forTheConnection=http://101.36.160.210:9901/Base/Login.action
62 64
 #登录密码输入错误限制登录时间
63 65
 loginTime=5
@@ -66,4 +68,4 @@ loginTime=5
66 68
 FLATID=511100008
67 69
 KEY=229558d3f8a9e2c67a7661a50487c790
68 70
 #webservice接口地址
69
-wsdlUrl=http://10.223.3.62:9025/yhzx/webServices/ExchangeServer?wsdl
71
+wsdlUrl=http://200.2.68.126:9025/yhzx/webServices/ExchangeServer?wsdl