wisdomisite-java/src/main/java/com/zhgd/xmgl/util/ProfileJudgeUtil.java

52 lines
898 B
Java
Raw Normal View History

2023-03-24 14:57:54 +08:00
package com.zhgd.xmgl.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
2023-03-24 17:32:22 +08:00
import javax.annotation.PostConstruct;
2023-03-24 14:57:54 +08:00
/**
* 环境判断
*/
@Component
public class ProfileJudgeUtil {
@Value("${spring.profiles.active}")
private String activeProfile;
2023-03-24 17:32:22 +08:00
private static String p;
@PostConstruct
public void setActiveProfile() {
p = activeProfile;
}
2023-03-24 14:57:54 +08:00
/**
* 是否金林湾生产环境
*
* @return
*/
2023-03-24 17:32:22 +08:00
public static boolean isJlw() {
return "ljw".equals(p);
}
/**
* 是否三江本地环境
*
* @return
*/
public static boolean isSjjtGsx() {
return "sjjt-gsx".equals(p);
2023-03-24 14:57:54 +08:00
}
2023-03-24 17:32:22 +08:00
/**
* 是否中建四局生产环境
*
* @return
*/
public static boolean isZjsj() {
return "zjsj".equals(p);
}
2023-03-24 14:57:54 +08:00
}