做成了 Spring Boot Starter 的形式,方便引入使用。
下载示例,类似于 @ResponseBody
:
@RequestMapping("/download") @ResponseExcel({"name", "book.name", "book.author"}) public List<Character> download() { return listCharacters(); }
上传示例,类似于 @RequestParam
:
@RequestMapping("/upload") @ResponseBody public List<Character> upload(@RequestExcel(value = "excel", targetClass = Character.class, fieldNames = {"name", "book.name", "book.author"}) List<Character> characters) { return characters; }
已提交至 Maven
中央仓库。
<dependency> <groupId>com.gaoice</groupId> <artifactId>easyexcel-spring-boot-starter</artifactId> <version>2.0</version> </dependency>
欢迎使用和 Star ^_^
GitHub: https://github.com/gaoice/easyexcel-spring-boot-starter
![]() | 1 ychost 2020-11-25 20:48:35 +08:00 赞!! |
2 fd7917931e 2020-11-26 13:58:47 +08:00 这个不错! |
3 shuige 2020-11-26 15:52:24 +08:00 2.0 哪里下载? |
![]() | 4 zsl199512101234 2020-11-26 16:20:42 +08:00 赞,一开始以为啥 Alibaba 的那个 easyexcel 呢 |
5 2han9wen71an 2020-11-26 16:26:31 +08:00 请问只能在 spring 上用吗?我们平常使用的 resteasy 加 guice 来开发能使用吗? |
![]() | OP @shuige 现在中央仓库应该可以了,[https://search.maven.org/artifact/com.gaoice/easyexcel-spring-boot-starter/2.0/jar]( https://search.maven.org/artifact/com.gaoice/easyexcel-spring-boot-starter/2.0/jar) ,其它仓库等同步过去才可以 @2han9wen71an 注解是只能在 Spring 中使用。工具类可以在其它框架使用:[https://github.com/gaoice/easyexcel]( https://github.com/gaoice/easyexcel) |
7 zm8m93Q1e5otOC69 2020-11-28 21:00:21 +08:00 支持 |