获取properties的值


方式1

@Value("${shoppingsheet.service.token}")
{
   private String          shoppingSheetServiceToken; 
}```
![](https://qiita-image-store.s3.amazonaws.com/0/121478/bd509191-07a6-b721-8a0d-98999e031d92.png)
#方式2 

@EnableConfigurationProperties({ DruidProperties.class, MySQLProperties.class })

![](https://qiita-image-store.s3.amazonaws.com/0/121478/744f9fa6-363a-10a6-ce2b-3d793512ebb0.png)
#方式3
java

@Autowired
private Environment env;
Long reLoadTime =Long.parseLong(env.getProperty("guavacache.time"));

你可能感兴趣的:(获取properties的值)