yutool-oss 文件存储
v1.4.3 从yutool-casdoor拆分出yutool-oss文件存储模块,避免文件存储服务与OAuth认证服务耦合,为后续接入更多类型存储服务做准备。
v1.4.3版本基于minio-cient实现了S3对象存储的文件上传、下载、删除接口,具体使用方式如下文。
maven依赖
在项目的
pom.xml文件添加如下依赖:xml<parent> <groupId>com.yupaits</groupId> <artifactId>yutool-parent</artifactId> <version>${yutool.version}</version> <relativePath/> </parent> <dependencies> <dependency> <groupId>com.yupaits</groupId> <artifactId>yutool-oss</artifactId> </dependency> </dependencies>1
2
3
4
5
6
7
8
9
10
11
12
13配置文件
在项目的配置文件
application.yml中添加以下配置:yml# MinIO存储服务配置 minio: endpoint: <endpoint> accessKey: <accessKey> secretKey: <secretKey> regionId: <regionId> bucket: <bucket>1
2
3
4
5
6
7注意: 带
<>的配置值需要替换为实际内容。
评论区留言准则:
1. 本评论区禁止传播封建迷信、吸烟酗酒、低俗色情、赌博诈骗等任何违法违规内容。
2. 当他人以不正当方式诱导打赏、私下交易,请谨慎判断,以防人身财产损失。
3. 请勿轻信各类招聘征婚、代练代抽、私下交易、购买礼包码、游戏币等广告信息,谨防网络诈骗。