码迷,mamicode.com
首页 > 编程语言 > 详细

springcloud feign传输List的坑

时间:2018-12-19 13:07:12      阅读:3139      评论:0      收藏:0      [点我收藏+]

标签:compare   response   nbsp   except   feign   value   inf   license   ntc   

无法直接传输List

错误方法1:

    @RequestMapping(value = "/stat/merchant/get_merchant_compare_info", method = RequestMethod.POST)
    @ResponseBody
    MerchantCompareTotalInfo getMerchantCompareInfo(
            @RequestParam(value = "licenseNoList")
            List<String> licenseNoList);

错误: feign.FeignException: status 500 reading MerchantStatRemoteApi#getMerchantCompareInfo(List); content

 

错误方法2:

   @RequestMapping(value = "/stat/merchant/get_merchant_compare_info", method = RequestMethod.POST)
    @ResponseBody
    MerchantCompareTotalInfo getMerchantCompareInfo(@RequestBody List<String> licenseNoList);

错误: feign.FeignException: status 500 reading MerchantStatRemoteApi#getMerchantCompareInfo(List); content

 

错误方法3:

    @RequestMapping(value = "/stat/merchant/get_merchant_compare_info", method = RequestMethod.POST)
    @ResponseBody
    MerchantCompareTotalInfo getMerchantCompareInfo(@RequestBody String[] licenseNoList);

服务端的数组是null

 

正确方法:

    @RequestMapping(value = "/stat/merchant/get_merchant_compare_info", method = RequestMethod.POST)
    @ResponseBody
    MerchantCompareTotalInfo getMerchantCompareInfo(@RequestParam("licenseNoList") String[] licenseNoList);

 

springcloud feign传输List的坑

标签:compare   response   nbsp   except   feign   value   inf   license   ntc   

原文地址:https://www.cnblogs.com/powerwu/p/10142101.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!