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的更多相关文章
随机推荐
- pyqt pyside QLineEdit 重写键盘事件
pyqt pyside QLineEdit 重写键盘事件 def keyPressEvent(self, event): if (event.modifiers() & QtCore.Qt.S ...
- JS对象与原型链
每个函数都存在一个prototype的属性,然后这个属性值为一个对象,我们称之为原型对象 每个对象都存在着一个隐藏的属性"__proto__" 这个属性引用了创建这个对象的函数的p ...
- python爬虫遇到https站点InsecureRequestWarning警告解决方案
python爬虫遇到https站点InsecureRequestWarning警告解决方案 加三行代码即可 from requests.packages.urllib3.exceptions impo ...
- 阿里云负载均衡SSL证书配置(更新)
阿里云负载均衡及应用防火墙SSL证书配置 转载请注明地址:http://www.cnblogs.com/funnyzpc/p/8908461.html 好久了呢,距上篇博客的这段时间中:考试.搬家.工 ...
- 在 CentOS7 安装 ELK
ELK是一个成熟的日志系统,主要功能有收集.分析.检索,详细见 elastic官网. 本文主要介绍如何在CentOS7下安装最新版本的ELK,当然现在docker已经有完全配置成功的elk容器,安装配 ...
- Linux filesystem
文件系统的运作与操作系统的文件数据有关.较新的操作系统的文件数据除了文件实际内容外,通常含有非常多的属性,例如Linux操作系统的文件权限(rwx)与文件属性(属主.属组.时间参数等).文件系统通常会 ...
- 【蓝桥杯真题】地宫取宝(搜索->记忆化搜索详解)
链接 [蓝桥杯][2014年第五届真题]地宫取宝 题目描述 X 国王有一个地宫宝库.是 n x m 个格子的矩阵.每个格子放一件宝贝.每个宝贝贴着价值标签. 地宫的入口在左上角,出口在右下角. 小明被 ...
- Vue.js的简介
vue.js简介 Vue.js读音 /vjuː/, 类似于 view Vue.js是前端三大新框架:Angular.js.React.js.Vue.js之一,Vue.js目前的使用和关注程度在三大 ...
- react-native-Cocoapods-Swift-Project
https://reactnative.cn/docs/integration-with-existing-apps/ 1.创建一个xcode工程,single View就行,项目语言选择swift, ...
- Homework 7 INF 552
Homework 7 INF 552,1. Generative Models for Text(a) In this problem, we are trying to build a genera ...