Python 官方文档:入门教程 => 点击学习
目录feign传输List的坑错误方法1错误方法2错误方法3feign调用传List接不到值feign传输List的坑 无法直接传输List 错误方法1 @RequestMappin
无法直接传输List
@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
@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
@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);
改为传数组 List<Long> 改为 Long[] 再用Arrays.asList()变成集合
以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。
--结束END--
本文标题: springcloudfeign传输List的坑及解决
本文链接: https://www.lsjlt.com/news/142666.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0