用法
1. application.yml 配置文件
xxx: ··· xxx: string: 字符串 # string: '字符串' special_string: "字\n符串" number: 6.6 list: [1,2,3] # list2: # - 1 # - 2 # - 3 # ... set: [1,2,3,1] # set2: # - one # - two # - one # ... map: {key1: value1, key2: value2,...} objectList: - object1_property1: xxx object1_property2: xxx ... - object2_property1: xxx object2_property2: xxx ...
2.Java 类
@Component @ConfigurationProperties(prefix = "xxx.···.xxx") public class xxx { private 数据类型 xxx; //... //getters, setters }