@Value注解的使用
项目启动,为某个变量设置值1.yml配置文件设置值:export: filePath: d://down/2.在ServiceImpl层通过注解注入值private String filePath;@Value("${export.filePath}")public void setFilePath(String failPath){ this.filePath = failPath;}3.使用设置的值//定义一个变量接收设置的值String filepath = fil
原创
2020-05-21 11:07:51 ·
603 阅读 ·
0 评论