静态方法想使用@Value注解的值
在方法上使用@Value注解
类上需要加上@Component注解
public static String appKey;
public static String appSecret;
@Value("${application.wms.appKey}")
private void setAppKey(String appKey) {
MesUrlUtil.appKey = appKey;
}
@Value("${application.wms.appSecret}")
private void setAppSecret(String appSecret) {
MesUrlUtil.appSecret = appSecret;
}