Fegin

springcloud feign传输List的坑
无法直接传输List

错误方法1:

@RequestMapping(value = "/stat/merchant/get_merchant_compare_info", method = RequestMethod.POST)
@ResponseBody
MerchantCompareTotalInfo getMerchantCompareInfo(
@RequestParam(value = "licenseNoList")
List 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 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);

版权声明:
作者:admin
链接:http://lixiaofang.top/2021/12/16/fegin/
来源:码农日志
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>