Commit f6ed221d authored by ag's avatar ag

fix : 删除无意义的定义.

parent 048836e6
...@@ -6,36 +6,18 @@ import lombok.extern.slf4j.Slf4j; ...@@ -6,36 +6,18 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public class TechEnvironment { 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() { public static String getEnv() {
return getInstance().env; return Foundation.server().getEnvType();
} }
/**
* 是否是生产环境
*
* @return true = 是生产环境, false = 不是生产环境
*/
public static boolean isPro() { public static boolean isPro() {
return getInstance().pro; return "pro".equalsIgnoreCase(getEnv());
} }
} }
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