# oss-spring-boot-project **Repository Path**: zhangbohui/oss-spring-boot-project ## Basic Information - **Project Name**: oss-spring-boot-project - **Description**: 阿里OSS | 七牛OSS,迁移到https://github.com/hocgin/spring-boot-starters-project - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-02-05 - **Last Updated**: 2024-02-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 介绍 > 集成`七牛OSS`/`阿里OSS` ## 使用 #### Maven ``` in.hocg.oss oss-spring-boot-starter 1.0.0-SNAPSHOT public public https://oss.sonatype.org/content/groups/public/ ``` #### application.yml ```yaml oss: enabled: true domain: http://endpoint.com secretKey: accessKey: space: type: ``` #### Java ```java @RestController @RequestMapping @RequiredArgsConstructor(onConstructor_ = {@Lazy}) public class IndexController { private final OssFileService ossFileService; @PostMapping("/upload") public ResponseEntity uploadFile(@RequestParam("file") MultipartFile file) throws IOException { return ResponseEntity.ok(ossFileService.upload(file)); } } ``` ## 项目结构 ```sbtshell . ├── README.md ├── pom.xml // 项目信息 ├── oss-spring-boot-autoconfigure // 启动器 ├── oss-spring-boot-parent // 依赖 └── oss-spring-boot-starter // Starter ```