No primary or single unique constructor found for interface java.util.List

报错截图:

报错内容:

复制代码
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 cause

java.lang.IllegalStateException: No primary or single unique constructor found for interface java.util.List

报错原因及修改方案:

对于非基本类型的参数,应该有@RequestParam注解,才能接收

java 复制代码
    @DeleteMapping
    public R<String> delete(@RequestParam List<Long> ids){
        setmealService.deleteWithDish(ids);
        return R.success("删除套餐成功");
    }

前后端交换注意多个参数接收需要有注解@RequestParam

相关推荐
大翻哥哥9 分钟前
Python 2025:量化金融与智能交易的新纪元
开发语言·python·金融
weixin_437830941 小时前
使用冰狐智能辅助实现图形列表自动点击:OCR与HID技术详解
开发语言·javascript·ocr
鹿鹿学长1 小时前
2025年全国大学生数学建模竞赛(C题) 建模解析|婴儿染色体数学建模|小鹿学长带队指引全代码文章与思路
c语言·开发语言·数学建模
zhousenshan1 小时前
Python爬虫常用框架
开发语言·爬虫·python
皮皮林5512 小时前
SpringBoot 全局/局部双模式 Gzip 压缩实战:14MB GeoJSON 秒变 3MB
java·spring boot
weixin_456904272 小时前
Spring Boot 用户管理系统
java·spring boot·后端
趁你还年轻_2 小时前
异步编程CompletionService
java
DKPT2 小时前
Java内存区域与内存溢出
java·开发语言·jvm·笔记·学习
sibylyue2 小时前
Guava中常用的工具类
java·guava
奔跑吧邓邓子2 小时前
【Java实战㉞】从0到1:Spring Boot Web开发与接口设计实战
java·spring boot·实战·web开发·接口设计