springboot yml配置和取值易犯错误

1、实体类

(1)忘记写getter setter 、无参和有参构造方法

(2)忘记

@Component
@ConfigurationProperties(prefix = "auth")

2、yml配置文件与实体类不对应,或映射的key不对

3、测试类

忘记 @Autowired
发布了120 篇原创文章 · 获赞 12 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/ljj123_/article/details/105326771