cn.ipokerface.minio.MinioAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minio-spring Show documentation
Show all versions of minio-spring Show documentation
Common Library of ipokerface
The newest version!
package cn.ipokerface.minio;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Created by PokerFace
* Create Date 2021/3/14.
* Email:
* Version 1.0.0
*
* Description:
*/
@Configuration
@EnableConfigurationProperties({MinioProperties.class})
public class MinioAutoConfiguration {
@Autowired
private MinioProperties minioProperties;
@Bean
public MinioClient minioClient() {
return MinioClient.builder()
.endpoint(minioProperties.getUrl())
.credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
.build();
}
}