Mistake08 2022-06-17 13:43
浏览 103
已结题

微服务使用feign 返回ModelAndView对象失败

微服务使用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]

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 已结题 (查看结题原因) 6月17日
    • 赞助了问题酬金5元 6月17日
    • 创建了问题 6月17日