感谢老哥的指导:https://blog.csdn.net/LX928525166/article/details/78753272
spring cloud通过feign去做项目模块调用但是另一个接口直接没有返回void,而是通过HttpServletRespoonse传输的流数据来响应,那么这边就要用Response来接收,注意
feign.Response;
是这个包下面的Response。
@PostMapping("downloadMerchantCheckfile") public void downloadMerchantCheckfile(@RequestBody @Valid MerchantCheckFileReqBo merchantCheckFileReqBo,HttpServletResponse response){ log.info("start download merchant check file {}",merchantCheckFileReqBo); merchantTradeService.downloadMerchantCheckFile(merchantCheckFileReqBo,response); }
/** * 下载昨日对账单 * * @return */ @RequestMapping(value = "/inner-api/v1/merchant/merchant-check/downloadMerchantCheckfile", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Response downloadCheckFile(@RequestBody MerchantCheckFileReqVO merchantCheckFileReqVO);