在Spring Boot中使用 @ConfigurationProperties 注解
Spring Boot可使用注解的方式将自定义的properties(yml)文件映射到实体bean中,yml文件内容如下:
system:
filePath: systemFilePath
photoPath: E:/
实体类中使用@ConfigurationProperties(prefix = "system") 注解,prefix = "system" 用来选择哪个...
原创
2019-01-21 10:37:09 ·
1418 阅读 ·
0 评论