{"id":20269130,"url":"https://github.com/pig-mesh/excel-spring-boot-starter","last_synced_at":"2025-05-15T07:08:06.026Z","repository":{"id":37396211,"uuid":"250940013","full_name":"pig-mesh/excel-spring-boot-starter","owner":"pig-mesh","description":"本项目旨在为用户提供一个便捷的 Excel 导出解决方案。基于阿里巴巴的 EasyExcel、FastExcel 库，结合 Spring Boot 框架，封装并优化了 Excel 文件的导出流程，帮助开发者更高效地实现数据导出功能。","archived":false,"fork":false,"pushed_at":"2025-04-16T11:05:08.000Z","size":336,"stargazers_count":572,"open_issues_count":17,"forks_count":160,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-21T18:27:17.952Z","etag":null,"topics":["ai","easyexcel","excel","fastexcel","java","spring","spring-boot"],"latest_commit_sha":null,"homepage":"https://www.yuque.com/pig4cloud/excel","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pig-mesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-29T02:46:58.000Z","updated_at":"2025-04-21T09:49:18.000Z","dependencies_parsed_at":"2023-01-30T05:30:43.424Z","dependency_job_id":"fed63f3e-69d7-463c-8bfd-8c43a8007c50","html_url":"https://github.com/pig-mesh/excel-spring-boot-starter","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Fexcel-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Fexcel-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Fexcel-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Fexcel-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pig-mesh","download_url":"https://codeload.github.com/pig-mesh/excel-spring-boot-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292042,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","easyexcel","excel","fastexcel","java","spring","spring-boot"],"created_at":"2024-11-14T12:23:30.062Z","updated_at":"2025-05-15T07:08:00.986Z","avatar_url":"https://github.com/pig-mesh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"以下是基于你提供的内容生成的开源项目 `excel-spring-boot-starter` 的 README 示例：\n\n---\n\n# Excel Spring Boot Starter\n\n`excel-spring-boot-starter` 是一个基于 `FastExcel` 实现的 Spring Boot Starter，用于简化 Excel 的读写操作。`FastExcel` 是一个 Java 开源项目，旨在以尽可能低的内存消耗实现对 Excel 文件的读写。通过 `FastExcel`，你可以在仅使用 64M 内存的情况下，在 1 分钟内读取 75M（46 万行，25 列）的 Excel 文件。\n\n- 更多详细的使用说明，请参考文档：[https://www.yuque.com/pig4cloud/ogf9nv](https://www.yuque.com/pig4cloud/ogf9nv)\n\n## 功能概述\n\n- 轻松集成到 Spring Boot 项目中，快速实现 Excel 文件的导入和导出。\n- 通过注解配置导入和导出的 Excel 文件格式。\n- 提供了简洁易用的 API，极大地减少了手动处理 Excel 文件的工作量。\n\n## 依赖引用\n\n项目已经上传至 Maven 中央仓库，只需引入以下依赖即可使用：\n\n| 版本    | 支持版本            |\n|-------|-------------------|\n| 3.4.0 | 适配 Spring Boot 3.x |\n| 1.2.7 | 适配 Spring Boot 2.x |\n\n在 `pom.xml` 中添加以下依赖：\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.pig4cloud.excel\u003c/groupId\u003e\n  \u003cartifactId\u003eexcel-spring-boot-starter\u003c/artifactId\u003e\n  \u003cversion\u003e${lastVersion}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## 导入 Excel\n\n### 控制器示例\n\n你可以通过在接口方法中使用 `@RequestExcel` 注解来接收上传的 Excel 文件并将其解析为 Java 对象列表：\n\n```java\n@PostMapping(\"/upload\")\npublic void upload(@RequestExcel List\u003cDemoData\u003e dataList, BindingResult bindingResult) {\n  // JSR 303 校验通用校验获取失败的数据\n  List\u003cErrorMessage\u003e errorMessageList = (List\u003cErrorMessage\u003e) bindingResult.getTarget();\n}\n```\n\n### 实体类定义\n\n需要先定义与 Excel 表格对应的实体类，并使用 `@ExcelProperty` 注解来标注 Excel 列的索引：\n\n```java\n@Data\npublic class Demo {\n  @ExcelProperty(index = 0)\n  private String username;\n\n  @ExcelProperty(index = 1)\n  private String password;\n}\n```\n\n### 示例表格\n\n下图展示了与上述实体类对应的 Excel 表格：\n\n![Example Excel](https://minio.pigx.top/oss/1618560470.png)\n\n## 导出 Excel\n\n你只需在控制器方法中返回一个 `List`，并使用 `@ResponseExcel` 注解即可将数据导出为 Excel 文件：\n\n```java\n@Documented\n@Target(ElementType.METHOD)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface ResponseExcel {\n  String name() default \"\";\n  ExcelTypeEnum suffix() default ExcelTypeEnum.XLSX;\n  String password() default \"\";\n  Sheet[] sheets() default @Sheet(sheetName = \"sheet1\");\n  boolean inMemory() default false;\n  String template() default \"\";\n  String[] include() default {};\n  String[] exclude() default {};\n  Class\u003c? extends WriteHandler\u003e[] writeHandler() default {};\n  Class\u003c? extends Converter\u003e[] converter() default {};\n  Class\u003c? extends HeadGenerator\u003e headGenerator() default HeadGenerator.class;\n}\n```\n\n## 使用文档\n\n更多详细的使用说明，请参考文档：[https://www.yuque.com/pig4cloud/ogf9nv](https://www.yuque.com/pig4cloud/ogf9nv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpig-mesh%2Fexcel-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpig-mesh%2Fexcel-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpig-mesh%2Fexcel-spring-boot-starter/lists"}