项目配置属性的值作为条件
配置的属性满足某个值,才注册这个bean
language-trainer:
login:
oauth-enabled: false
@Bean
@ConditionalOnProperty(name = "language-trainer.login.oauth-enabled", havingValue = "true")
PREVIOUSSpring Boot自定义配置属性
NEXTYAML配置中引用其它变量
配置的属性满足某个值,才注册这个bean
language-trainer:
login:
oauth-enabled: false
@Bean
@ConditionalOnProperty(name = "language-trainer.login.oauth-enabled", havingValue = "true")