@EnableConfigurationProperties 注解的作用是:让使用了 @ConfigurationProperties 注解的类生效,并且将该类注入到 IOC 容器中,交由 IOC 容器进行管理
使用 @ConfigurationProperties + @Component 注解,来读取配置文件
有时配置@Component注解不生效,可以在启动类上配置@EnableConfigurationProperties注解
@EnableConfigurationProperties 注解的作用是:让使用了 @ConfigurationProperties 注解的类生效,并且将该类注入到 IOC 容器中,交由 IOC 容器进行管理
使用 @ConfigurationProperties + @Component 注解,来读取配置文件
有时配置@Component注解不生效,可以在启动类上配置@EnableConfigurationProperties注解