/**用于获取yml文件中的变量赋值给静态变量
* @Author: wuhf
* @Date: 2020/4/2
*/
@Configuration
public class YmlConfiguration {
public static String ehrZiroomUrl;
public static String ehrApiZiroomUrl;
public static String centerCode;
public static String centerName;
@Value("${ehr.ehrZiroomUrl}")
public void setEhrZiroomUrl(String ehrZiroomUrl) {
YmlConfiguration .ehrZiroomUrl = ehrZiroomUrl;
}
@Value("${ehr.ehrApiZiroomUrl}")
public void setEhrApiZiroomUrl(String ehrApiZiroomUrl) {
YmlConfiguration .ehrApiZiroomUrl = ehrApiZiroomUrl;
}
@Value("${org.centerCode}")
public void setCenterCode(String centerCode) {
YmlConfiguration .centerCode = centerCode;
}
@Value("${org.centerName}")
public void setCenterName(String centerName) {
YmlConfiguration .centerName = centerName;
}
}
从yml文件中获取变量赋值给静态变量
最新推荐文章于 2022-07-20 20:07:32 发布