# minio-spring-boot-starter **Repository Path**: schilings/minio-spring-boot-starter ## Basic Information - **Project Name**: minio-spring-boot-starter - **Description**: 🔥 Minio 对 象 存 储 的 Starter 快 速 启 动 器,开 箱 即 用 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 9 - **Created**: 2021-10-30 - **Last Updated**: 2021-10-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

minio-spring-boot-starter

基 于 Minio 对 象 存 储 的 Spring Boot 快 速 启 动 器,开 箱 即 用


### 项目介绍 基 于 Minio 对 象 存 储 的 Spring Boot 快 速 启 动 器,开 箱 即 用

参考API

### 依赖关系 | 项目名称 | 版本号 | 官网地址 | | :---------: | :-----------: | ----------------------------------------------------- | | minio | 7.1.0 | https://docs.min.io/docs/java-client-quickstart-guide | | spring-boot | 2.3.7.RELEASE | https://spring.io/projects/spring-boot | | hutool-core | 5.7.5 | https://www.hutool.cn | ### 如何使用 Maven 在项目的pom.xml中添加 ```xml jitpack.io https://jitpack.io ``` ```xml com.gitee.pear-admin minio-spring-boot-starter ${last.version} ``` Gradle ```groovy allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` ```groovy dependencies { implementation 'com.gitee.pear-admin:minio-spring-boot-starter:${last.version}' } ``` ### 快速上手 配置 ``` minio: ## minio 服务地址 url: 127.0.0.1:5000 ## 账户 accessKey: pear-admin ## 密码 secretKey: pear-admin ## 桶 bucket: default ## 当桶不存在,是否创建 createBucket: true ## 启动检测桶,是否存在 checkBucket: true ## 连接超时 connectTimeout: 6000 ## 写入超时 writeTimeout: 2000 ## 读取超时 readTimeout: 2000 ``` 使用 ``` @RestController @RequestMapping("/api/bucket") public class BucketController { @Autowired private MinioTemplate minioTemplate; @RequestMapping("/create") public Result create(String bucketName) { if(!minioTemplate.bucketExists(bucketName)) { minioTemplate.createBucket(bucketName); return Result.success("创建成功"); } return Result.failure("桶,已存在"); } } ``` ### 项目贡献者 [![Giteye chart](https://chart.giteye.net/gitee/pear-admin/minio-spring-boot-starter/DDPB5C75.png)](https://giteye.net/chart/DDPB5C75) ### 趋势图 [![Giteye chart](https://chart.giteye.net/gitee/pear-admin/minio-spring-boot-starter/SJRQAG4F.png)](https://giteye.net/chart/SJRQAG4F)