Commit f09c758d authored by zero-mac's avatar zero-mac

feature: 发布0.0.7版本:

1. spring-cloud由Dalston.SR4升级到Edgware.RELEASE
2. 提供获取当前环境的工具类
parent 4b630b6f
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>cn.quantgroup</groupId> <groupId>cn.quantgroup</groupId>
<artifactId>commons</artifactId> <artifactId>commons</artifactId>
<version>0.0.6</version> <version>0.0.7</version>
<packaging>jar</packaging> <packaging>jar</packaging>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.SR4</version> <version>Edgware.RELEASE</version>
<scope>import</scope> <scope>import</scope>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
......
...@@ -34,7 +34,7 @@ import javax.servlet.Servlet; ...@@ -34,7 +34,7 @@ import javax.servlet.Servlet;
* on the classpath. * on the classpath.
*/ */
@Configuration @Configuration
//@ConditionalOnProperty(prefix = "shutdown.graceful", name = "enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnProperty(prefix = "shutdown.graceful", name = "enabled", havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(GracefulShutdownProperties.class) @EnableConfigurationProperties(GracefulShutdownProperties.class)
@Import(EmbeddedServletContainerAutoConfiguration.BeanPostProcessorsRegistrar.class) @Import(EmbeddedServletContainerAutoConfiguration.BeanPostProcessorsRegistrar.class)
public class GracefulShutdownAutoConfiguration { public class GracefulShutdownAutoConfiguration {
......
package cn.quantgroup.tech.util;
import com.ctrip.framework.foundation.Foundation;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class TechEnvironment {
private volatile static TechEnvironment instance;
private boolean pro = false;
private String env;
private TechEnvironment() {
String envType = Foundation.server().getEnvType();
env = envType;
if (envType.equals("pro")) {
pro = true;
}
}
private static TechEnvironment getInstance() {
if (instance == null) {
synchronized (TechEnvironment.class) {
if (instance == null) {
instance = new TechEnvironment();
}
}
}
return instance;
}
public static String getEnv() {
return getInstance().env;
}
public static boolean isPro() {
return getInstance().pro;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment