{"id":20269116,"url":"https://github.com/pig-mesh/oss-spring-boot-starter","last_synced_at":"2025-05-16T07:07:30.450Z","repository":{"id":45775549,"uuid":"279780360","full_name":"pig-mesh/oss-spring-boot-starter","owner":"pig-mesh","description":"兼容S3协议的通用文件存储工具类","archived":false,"fork":false,"pushed_at":"2024-11-06T09:15:01.000Z","size":68,"stargazers_count":256,"open_issues_count":1,"forks_count":88,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-08T17:18:10.353Z","etag":null,"topics":["oss","s3","s3-storage","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","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-07-15T06:07:01.000Z","updated_at":"2025-02-07T13:30:27.000Z","dependencies_parsed_at":"2024-11-14T12:36:33.454Z","dependency_job_id":null,"html_url":"https://github.com/pig-mesh/oss-spring-boot-starter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Foss-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Foss-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Foss-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pig-mesh%2Foss-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/oss-spring-boot-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485065,"owners_count":22078767,"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":["oss","s3","s3-storage","spring-boot"],"created_at":"2024-11-14T12:23:25.832Z","updated_at":"2025-05-16T07:07:29.729Z","avatar_url":"https://github.com/pig-mesh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## oss-spring-boot-starter\n\n兼容S3 协议的通用文件存储工具类 ，支持 兼容S3 协议的云存储 \n\n- MINIO\n- 阿里云\n- 华为云\n- 腾讯云\n- 京东云\n\n...\n\n## spring boot starter依赖\n\n\n| 版本 | 支持 |\n|-------|--|\n| 3.0.0 | 适配 SpringBoot3.x |\n| 1.0.5 | 适配 SpringBoot2.x |\n\n- 方便在 web 环境下使用 `oss` ，已上传至 maven 仓库\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.pig4cloud.plugin\u003c/groupId\u003e\n    \u003cartifactId\u003eoss-spring-boot-starter\u003c/artifactId\u003e\n    \u003cversion\u003e${lastVersion}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## 使用方法\n\n### 配置文件\n\n```yaml\noss:\n  endpoint: http://minio.pig4cloud.com\n  access-key: lengleng\n  secret-key: lengleng\n```\n\n### 代码使用\n\n```java\n@Autowired\nprivate OssTemplate template;\n/**\n * 上传文件\n * 文件名采用uuid,避免原始文件名中带\"-\"符号导致下载的时候解析出现异常\n *\n * @param file 资源\n * @return R(bucketName, filename)\n */\n@PostMapping(\"/upload\")\npublic R upload(@RequestParam(\"file\") MultipartFile file, HttpServletRequest request) {\n\ttemplate.putObject(CommonConstants.BUCKET_NAME, fileName, file.getInputStream());\n\treturn R.ok(resultMap);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpig-mesh%2Foss-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpig-mesh%2Foss-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpig-mesh%2Foss-spring-boot-starter/lists"}