package com.zhgd.xmgl.util; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.Arrays; import java.util.stream.Stream; /** * 环境判断 */ @Component public class ProfileJudgeUtil { @Value("${spring.profiles.active}") private String activeProfile; /** * 是否金林湾生产环境 * * @return */ public boolean isJlwProd() { return "ljw".equals(activeProfile); } /** * 是否三江本地环境 * * @return */ public boolean isSjjtGsxDev() { return "sjjt-gsx".equals(activeProfile); } /** * 是否三江环境(包括本地、测试、生产) * * @return */ public boolean isSjjt() { return Stream.of("sjjt-gsx", "sjjt-prod").anyMatch(s -> s.equals(activeProfile)); } /** * 是否中建四局生产环境 * * @return */ public boolean isZjsjProd() { return "zjsj".equals(activeProfile); } /** * 是否云联万物生产环境 * * @return */ public boolean isYlwwProd() { return "ylww".equals(activeProfile); } }