场景
SpringBoot中通过ConfigurationProperties注解的方式读取application.yml中配置的属性值:
SpringBoot中通过ConfigurationProperties注解的方式读取application.yml中配置的属性值_demoenabled: true-CSDN博客
参考上面获取yml配置文件中简单的配置项的方式。
如果需要获取application.yml中配置的list数据,且每个list有多个属性的内容,比如下面添加在application.yml中的内容
locators:
locatorList:
- id: 0
slaveId: 1
offset: 0
- id: 1
slaveId: 1
offset: 1
- id: 2
&nbs