Giter Club home page Giter Club logo

easyexcel-spring-boot-starter's Introduction

Easyexcel Spring Boot Starter

概述

在 Spring Boot 中使用 @RequestExcel@ResponseExcel 注解轻松上传和下载 Excel 文件。

使用

下载示例,类似于 @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 **仓库。

Maven

<dependency>
    <groupId>com.gaoice</groupId>
    <artifactId>easyexcel-spring-boot-starter</artifactId>
    <version>2.1</version>
</dependency>

新版本

  • v 2.1,提升 @ResponseExcel 注解优先级,现在可以在 @RestController 中使用 @ResponseExcel 注解。

  • v 2.0,新增 @RequestExcel 注解。

示例

查看 ExcelUploadController 中的上传示例。

查看 ExcelDownloadController 中的下载示例。

运行 DemoApplication ,在 upload.html 尝试导入功能,访问相应的接口查看效果。

easyexcel-spring-boot-starter's People

Contributors

gaoice avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.