201808_summary
@Consumes @Produces分别表示入参和出参数吗
可以这样讲。但是不是很到位。
是限定作用,类似于filter
consumes: 指定处理请求的提交内容类型(Content-Type),例如application/json, text/html;
produces: 指定返回的内容类型,仅当request请求头中的(Accept)类型中包含该指定类型才返回;
Elastic-Job——分布式定时任务框架
spring boot中使用@SpringBootApplication指定类为应用启动类,
自动扫描于当前类同级以及子包下的相应注解注册为spring beans,
在类中main方法中通过SpringApplication的run方法启动应用。
eg:
- package com.lanhuigu;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- @SpringBootApplication
- public class SpringBootApp {
- public static void main( String[] args ) {
- SpringApplication.run(SpringBootApp.class, args);
- }
- }
使用@SpringBootApplication注解,等价于同时使用@Configuration @EnableAutoConfiguration @ComponentScan
这三个注解的默认属性,同时,使用@SpringBootApplication也可以接合使用@EnableAutoConfiguration @ComponentScan。
其中@ComponentScan很有用,可以通过该注解指定扫描某些包下包含如下注解的均自动注册为spring beans:
@Component, @Service, @Repository, @Controller,@Entity等等。
eg:
- package com.lanhuigu;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.context.annotation.ComponentScan;
- @SpringBootApplication
- @ComponentScan(basePackages = {"com.lanhuigu","com.ghg"})// string[]
- public class SpringBootApp {
- public static void main( String[] args ) {
- SpringApplication.run(SpringBootApp.class, args);
- }
- }
1.什么是API网关?
API网关是一个轻量的java http 接口组件,可无缝将普通的 Serive 方法转换成 http 接口。并从已下几点来达到提高开发效率与接口质量的目的。
- 去掉mvc控制器,将http请求直接无缝接入JAVA服务接口
- 统一出入参格式
- 统一异常规范
- 自动检测服务接口规范
@BeanParam
如果传递的参数较多,可以自己写个bean,bean中的字段使用@PathParam、@QueryParam、@FormParam、@FormDataParam、@MatrixParam、@HeaderParam、@CookieParam来注解。而在resouces中具体方法参数中就可以使用@BeanParam来注解这个自定义的bean
201808_summary的更多相关文章
随机推荐
- 业务线--node中间层做一个透传的项目
1,node中间层总结 1,ejs引入vue的js,路由层(直接透传,自定义行的),比较浅层的一层 中间件的引入 ? ) { // 与rd约定,接口成功返回code===0,其余为失败 console ...
- 权限管理——shiro
1.shiro整合spring a.导入依赖 <properties> <shiro.version>1.2.4</shiro.version> </prop ...
- Python数据分析基础教程
Python数据分析基础教程(第2版)(高清版)PDF 百度网盘 链接:https://pan.baidu.com/s/1_FsReTBCaL_PzKhM0o6l0g 提取码:nkhw 复制这段内容后 ...
- select应用
服务端源码 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun "& ...
- CSS3_伸缩盒模型_弹性布局_等分布局_flex 布局
伸缩盒模型 CSS3 引入的布局模式 Flexbox 布局 主要思想: 让容器有能力让其子项目能够改变其宽度,高度,以最佳方式填充可用空间. 特点: display: flex; 只能控制其子元 ...
- React_生命周期
初始化 ReactDOM.render(jsx, 原生 DOM 对象): 组件类定义 static defaultProps = {} static propTypes = {} constructo ...
- [LeetCode] Unique Morse Code Words 独特的摩斯码单词
International Morse Code defines a standard encoding where each letter is mapped to a series of dots ...
- laravel5.5+vue+Element-ui+vux环境搭建(webpack+laravelMix)(转)
本教程例子可到GitHub 上下载 Laravel5.5-Vue-Element-ui-Vux 1.laravel5.5安装,详情请参考: https://laravelacademy.org/pos ...
- Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:
表示jar所在位置文件夾中沒有下載好,將目標目錄刪除,重新maven下就好了
- 甘特图dhtmlx Gantt入门
(以下截图来自别人的博客,来源地址已经忘记了,若后期找到会补充上来!) API地址:https://docs.dhtmlx.com/gantt/desktop__guides.html,这是英文的网页 ...