直接先贴图(文中的url做了修改):

代码如下:
@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);
}
通过接口文档,需要弄清楚下面几条信息:
1、确定请求方式——post
2、拿到URL:

本文通过实例展示了如何根据接口文档创建一个接口类,重点讲解了@FeignClient、@RequestParam和@PostMapping的使用。详细解释了请求方式、URL、路径、参数以及返回值的确定,并提到了GET和POST请求中@RequestParam的参数处理。
&spm=1001.2101.3001.5002&articleId=98635220&d=1&t=3&u=21beb1b637124027b1e9745886523949)
2381

被折叠的 条评论
为什么被折叠?



