本次例子,用到的参数是name,url,fallback
技术总结:
并且需要知道,返回值表示的意思
请求参数
本次例子,用到的参数是path,produces
可以通过required=false或者true来要求@RequestParam配置的前端参数是否一定要传,此处history不一定要传。不传的话会给参数赋值为null。
返回形式:JSON
股票交易接口在哪,接口的路径:/a/b
本次例子,用到的参数是name,required
通过股票交易接口在哪,接口文档,需要弄清楚下面几条信息:
代码如下:
@FeignClient(name = 'Z_KPI_API',url = '${Z.KPI.url:http://11.11.111.111:8080}',fallback = ZApiClientFallback.class)
public Interface ZApiClient{
@PostMapping(path = 'a/b',produces = 'application/json')
ZQueryResult query( @RequestParam('hostName')String hostName,
@RequestParam(name = 'hostType',defaultValue = 'ne')String hostType,
@RequestParam('fromTime')String fromTime,
@RequestParam('endTime')String endTime,
@RequestParam(name = 'cpllectType',defaultValue = 'Zabbix')String collectType,
@RequestParam(name = 'history',required = false)Integer history);
}
确定请求方式——post
文章为作者独立观点,不代表股票交易接口观点