springcloud feign传输List的坑及解决

网友投稿 866 2022-10-20

springcloud feign传输List的坑及解决

springcloud feign传输List的坑及解决

目录feign传输List的坑错误方法1错误方法2错误方法3feign调用传List接不到值

feign传输List的坑

无法直接传输List

错误方法1

@RequestMapping(value = "/stat/merchant/get_merchant_compqDbwwAare_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);

feign调用传List接不到值

改为传数组 List 改为 Long[] 再用Arrays.asList()变成集合

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:小程序技术如何提升桌面应用安全等级?
下一篇:【Android 常见控件使用】DanmakuView(弹幕)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~