建个文件

在启动类
@Bean
public static PropertySourcesPlaceholderConfigurer properties() {
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
// yaml.setResources(new FileSystemResource("AlipayConfig.yml"));//File引入
yaml.setResources(new ClassPathResource("AlipayConfig.yml"));//class引入
configurer.setProperties(yaml.getObject());
return configurer;
}
加载属性

使用的 lombok.Data; 插件免去get,set
1554



被折叠的 条评论
为什么被折叠?



