You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package com.supervision.config;
|
|
|
|
|
|
|
|
|
|
import io.minio.MinioClient;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.context.annotation.Primary;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Endpoint 对象存储服务的URL
|
|
|
|
|
* Access Key Access key就像用户ID,可以唯一标识你的账户。
|
|
|
|
|
* Secret Key Secret key是你账户的密码。
|
|
|
|
|
*
|
|
|
|
|
* @author qmy
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
|
|
|
|
@Configuration
|
|
|
|
|
public class MinioConfig {
|
|
|
|
|
|
|
|
|
|
@Value("${minio.endpoint}")
|
|
|
|
|
private String endpoint;
|
|
|
|
|
|
|
|
|
|
@Value("${minio.accessKey}")
|
|
|
|
|
private String accessKey;
|
|
|
|
|
|
|
|
|
|
@Value("${minio.secretKey}")
|
|
|
|
|
private String secretKey;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@Primary
|
|
|
|
|
public MinioClient minioClient() {
|
|
|
|
|
// Create a minioClient with the MinIO server playground, its access key and secret key.
|
|
|
|
|
return MinioClient.builder()
|
|
|
|
|
.endpoint(endpoint)
|
|
|
|
|
.credentials(accessKey, secretKey)
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|