package com.whyc.constant; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /** * Yaml配置参数 实体类 */ @Component public class YamlProperties { /** * 运行模式:dev,prod */ public static String profileType; /**系统运行模式*/ public static Integer runModel; @Value("${spring.profiles.active}") public void setProfileType(String profileType) { YamlProperties.profileType = profileType; } @Value("${configFile.type}") public void setRunModel(Integer runModel) { YamlProperties.runModel = runModel; } }