时间:2023-01-24 10:48:46 | 栏目:JAVA代码 | 点击:次
无法直接传输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()变成集合