在 Spring Boot 中使用 @RequestExcel 和 @ResponseExcel 注解即可轻松上传和下载 Excel 文件。使用 下载示例,类似于 @ResponseBody :@RequestMapping("/download") @ResponseExcel({"name", "book.name", "book.author"}) public Listdownload() { return listCharacters(); } 上传示例,类似于 @RequestParam :@RequestMapping("/upload") @ResponseBody public List upload(@RequestExcel(value = "excel", targetClass = Character.class, fieldNames = {"name", "book.name", "book.author"}) List characters) { return characters; } 已提交至 Maven 中央仓库,引入以下依赖即可使用: 可在 GitHub 上搜索此项目,查看项目源码和更多的使用示例哦。 com.gaoice easyexcel-spring-boot-starter2.0