Feign文件下載

感謝老哥的指導:https://blog.csdn.net/LX928525166/article/details/78753272spring

spring cloud經過feign去作項目模塊調用可是另外一個接口直接沒有返回void,而是經過HttpServletRespoonse傳輸的流數據來響應,那麼這邊就要用Response來接收,注意api

feign.Response;

是這個包下面的Response。app

@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);
相關文章
相關標籤/搜索