能够这样讲。可是不是很到位。
是限定做用,相似于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