报错截图:
报错内容:
2023-08-04 15:46:32.884 ERROR 14260 --- [io-8080-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: No primary or single unique constructor found for interface java.util.List] with root causejava.lang.IllegalStateException: No primary or single unique constructor found for interface java.util.List
报错原因及修改方案:
对于非基本类型的参数,应该有@RequestParam注解,才能接收
@DeleteMappingpublic R<String> delete(@RequestParam List<Long> ids){setmealService.deleteWithDish(ids);return R.success("删除套餐成功");}
前后端交换注意多个参数接收需要有注解@RequestParam