1. add config
minio:
endpoint: http://ip:9000#Minio服务所在地址
bucketName: yuanwu#存储桶名称
accessKey: minio #访问的key
secretKey: minio #访问的秘钥
2. springboot config
@Data
@Configuration
@ConfigurationProperties(prefix ="minio")
public class MinioConfig {
private Stringendpoint;
private StringaccessKey;
private StringsecretKey;
private StringbucketName;
@Bean
public MinioClientminioClient() {
return MinioClient.builder()
.endpoint(endpoint)
.credentials(accessKey,secretKey)
.build();
}
}
网友评论