微服务使用feign 返回ModelAndView对象失败
// 调用服务
@GetMapping(value = "/batchExport")
public ModelAndView batchExport(@RequestParam Map<String, Object> params) {
return orderInfoFeignClient.batchExport(params);
}
// fegin
@ApiOperation("批量导出订单")
@GetMapping(value = "/order/info/batchExport")
ModelAndView batchExport(@RequestParam Map<String, Object> params);
// 被动用服务
@ApiOperation("导出发货")
@GetMapping(value = "/batchExport")
public ModelAndView batchExport(@RequestParam Map<String, Object> params) {
return orderInfoService.batchExport(params);
}
被调用服务一切正常,但是在fegin接收ModelAndView对象时出现问题,报错信息如下
Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.web.servlet.ModelAndView] and content type [application/octet-stream]