spring boot 配置總結

1、@value 單個配置 2、@Component @ConfigurationProperties 如果配置項很多,之間還有聯繫,把這些配置放到一個類裏面去 用@Autowired讓 limitConfig的實體bean注入到HelloController裏面,讓HelloController可以使用 limitConfig裏面的方法。
相關文章
相關標籤/搜索