标签:ati 就是 pre getter todo efi ica ring span
1、application.properties
test.name=111
test.names=‘111‘,‘bbb‘,‘ccca‘
2、配置类
/** * @Author jijiecong * @Date 2021/6/4 17:13 * @Version 1.0 * @Description TODO */ @Configuration @ConfigurationProperties(prefix = "test") public class LeetCodeConfig { private String name; private List<String> names = new ArrayList<>(); public List<String> getNames() { return names; } public void setNames(List<String> names) { this.names = names; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
3、注意点
注解@ConfigurationProperties(prefix = "test")就是配置的前缀
name和names必须和配置里的名字一致
提供setter和getter方法。
标签:ati 就是 pre getter todo efi ica ring span
原文地址:https://www.cnblogs.com/jijiecong/p/14870735.html