{"id":19325481,"url":"https://github.com/easyj-projects/easyj","last_synced_at":"2025-04-22T20:31:37.979Z","repository":{"id":37651785,"uuid":"383649715","full_name":"easyj-projects/easyj","owner":"easyj-projects","description":"简化java项目开发","archived":false,"fork":false,"pushed_at":"2024-07-16T07:15:05.000Z","size":3134,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-07-16T09:25:51.389Z","etag":null,"topics":["java","spring-boot"],"latest_commit_sha":null,"homepage":"https://easyj.icu","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/easyj-projects.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":"2021-07-07T02:19:31.000Z","updated_at":"2024-07-16T07:15:08.000Z","dependencies_parsed_at":"2024-06-07T07:26:04.956Z","dependency_job_id":"8cb924c6-8d44-4fdc-86b7-d18f6d917332","html_url":"https://github.com/easyj-projects/easyj","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyj-projects%2Feasyj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyj-projects%2Feasyj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyj-projects%2Feasyj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyj-projects%2Feasyj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easyj-projects","download_url":"https://codeload.github.com/easyj-projects/easyj/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223903480,"owners_count":17222551,"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":["java","spring-boot"],"created_at":"2024-11-10T02:10:11.427Z","updated_at":"2025-04-22T20:31:37.967Z","avatar_url":"https://github.com/easyj-projects.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# easyj\n\n### 官网\n[https://easyj.icu](https://easyj.icu)\n\n\n### 介绍\n\n本项目主要提供一系列的封装好的工具类或功能，供大家使用。 项目宗旨：能用一行代码解决的问题，就不用两行。\n\n### 安装教程\n\n1. springboot项目\n\n```xml\n\u003cdependencyManagement\u003e\n\t\u003cdependencies\u003e\n\t\t\u003cgroupId\u003eicu.easyj.boot\u003c/groupId\u003e\n\t\t\u003cartifactId\u003eeasyj-spring-boot-bom\u003c/artifactId\u003e\n\t\t\u003cversion\u003e0.8.0-SNAPSHOT\u003c/version\u003e\n\t\t\u003ctype\u003epom\u003c/type\u003e\n\t\t\u003cscope\u003eimport\u003c/scope\u003e\n\t\u003c/dependencies\u003e\n\u003c/dependencyManagement\u003e\n```\n\n```xml\n\u003cdependencies\u003e\n\t\u003c!-- @Cache304所需依赖 --\u003e\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eicu.easyj.boot\u003c/groupId\u003e\n\t\t\u003cartifactId\u003eeasyj-spring-boot-starter-web\u003c/artifactId\u003e\n\t\u003c/dependency\u003e\n\t\u003c!-- @ExcelExport所需依赖 --\u003e\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eicu.easyj.boot\u003c/groupId\u003e\n\t\t\u003cartifactId\u003eeasyj-spring-boot-starter-poi-excel\u003c/artifactId\u003e\n\t\u003c/dependency\u003e\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eicu.easyj.boot\u003c/groupId\u003e\n\t\t\u003cartifactId\u003eeasyj-spring-boot-starter-poi-excel-afterturn\u003c/artifactId\u003e\n\t\u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n2. 非springboot项目\n\n```xml\n\u003cdependencies\u003e\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003eicu.easyj\u003c/groupId\u003e\n\t\t\u003cartifactId\u003eeasyj-all\u003c/artifactId\u003e\n\t\t\u003cversion\u003e0.8.0-SNAPSHOT\u003c/version\u003e\n\t\u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### 使用说明\n\n###### # 注：下面的`MyEntity`为任意的自定义领域模型类。\n\n#### 1、`@ExcelExport, @Excel, @ExcelCell`三个注解，实现Excel文件导出功能\n\n1. 在Controller接口上，添加`@ExcelExport(fileNamePre = \"文件名前缀\", dataType = MyEntity.class)`\n2. 在`MyEntity`类上添加`@Excel`注解，用于配置导出的表格的样式，如：是否添加序号列、是否冻结首行、是否添加数据筛选等等\n3. 在`MyEntity`类的属性上添加`@ExcelCell`注解，用于配置列相关信息，如：列名、列号、列宽、列字体颜色、列背景颜色等等\n4. 请求多传一个GET参数`\u0026doExport=true`，表示此次请求为文件导出请求\n5. 后端在接收到`doExport`参数时，此次请求，将分页功能禁用掉，主要是为了导出不分页情况下的所有数据\n\n#### 2、`ExcelUtils`一个方法，`@Excel, @ExcelCell`两个注解，实现Excel文件导入功能\n\n1.\n\n```java\n@RestController\npublic class XxxController {\n\n\t@PostMapping(\"/test/excel-import\")\n\tpublic List\u003cMyEntity\u003e testExcelImport(@RequestPart(\"file\") MultipartFile file) {\n\t\t// excel文件转为列表数据\n\t\tList\u003cMyEntity\u003e list = ExcelUtils.toList(file.getInputStream(), MyEntity.class);\n\n\t\t// 打印一下\n\t\tSystem.out.println(StringUtils.toString(list));\n\n\t\t// 将转换后的数据直接返回，方便查看\n\t\treturn list;\n\t}\n}\n```\n\n2. `@Excel`和`@ExcelCell`注解的使用方法同`Excel文件导出功能`中的使用方法\n\n#### 3、`@Cache304`一个注解实现GET接口的304缓存功能\n\n1. 在Controller的GET接口上，添加`@Cache304(cacheSeconds = 60, cacheDays = 1, useMaxAge = true)`\n2. 在自定义领域模型类`MyEntity`上添加`@Excel`注解，用于配置导出的表格的样式\n3. 在自定义领域模型类`MyEntity`的属性上添加`@ExcelCell`注解，用于配置列相关信息\n\n### 使用示例\n\n详见使用示例项目：[https://gitee.com/easyj-projects/easyj-samples](https://gitee.com/easyj-projects/easyj-samples)\n\n### 参与贡献的方法\n\n1. Fork 本仓库到自己的个人仓库中\n2. 在Fork下来的仓库的最新代码上新建分支，名称分支可任意自定义\n3. 编写代码，并Push\n4. 回到本仓库提交 Pull Request，[传送门](https://gitee.com/easyj-projects/easyj/pull/new)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasyj-projects%2Feasyj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasyj-projects%2Feasyj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasyj-projects%2Feasyj/lists"}