能夠這樣講。可是不是很到位。
是限定做用,相似於filter
consumes: 指定處理請求的提交內容類型(Content-Type),例如application/json, text/html;
produces: 指定返回的內容類型,僅當request請求頭中的(Accept)類型中包含該指定類型才返回;
spring boot中使用@SpringBootApplication指定類爲應用啓動類,html
自動掃描於當前類同級以及子包下的相應註解註冊爲spring beans,java
在類中main方法中經過SpringApplication的run方法啓動應用。spring
eg:json
使用@SpringBootApplication註解,等價於同時使用@Configuration @EnableAutoConfiguration @ComponentScanmvc
這三個註解的默認屬性,同時,使用@SpringBootApplication也能夠接合使用@EnableAutoConfiguration @ComponentScan。app
其中@ComponentScan頗有用,能夠經過該註解指定掃描某些包下包含以下註解的均自動註冊爲spring beans:框架
@Component, @Service, @Repository, @Controller,@Entity等等。分佈式
eg:post
API網關是一個輕量的java http 接口組件,可無縫將普通的 Serive 方法轉換成 http 接口。並從已下幾點來達到提升開發效率與接口質量的目的。ui
若是傳遞的參數較多,能夠本身寫個bean,bean中的字段使用@PathParam、@QueryParam、@FormParam、@FormDataParam、@MatrixParam、@HeaderParam、@CookieParam來註解。而在resouces中具體方法參數中就能夠使用@BeanParam來註解這個自定義的bean