All Downloads are FREE. Search and download functionalities are using the official Maven repository.

plus.easydo.starter.file.minio.config.MinioAutoConfiguration Maven / Gradle / Ivy

The newest version!
package plus.easydo.starter.file.minio.config;

import io.minio.MinioClient;
import io.minio.errors.InvalidEndpointException;
import io.minio.errors.InvalidPortException;
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;
import plus.easydo.starter.file.minio.MinioTemplate;
import plus.easydo.starter.file.minio.service.MinioFileStoreServer;


/**
 * minio自动装配
 * @author laoyu
 * @version 1.0
 */
@Configuration
@EnableConfigurationProperties(MinioProperties.class)
public class MinioAutoConfiguration {

    @Autowired
    private MinioProperties minioProperties;


    @Bean
    public MinioClient minioClient() throws InvalidPortException, InvalidEndpointException {
        return new MinioClient( minioProperties.getServerAddress(), minioProperties.getAccessKey(), minioProperties.getSecretKey()

        );
    }

    @Bean
    public MinioTemplate minioTemplate(){
        return new MinioTemplate();
    }

    @Bean
    public MinioFileStoreServer fileStoreService(){
        return new MinioFileStoreServer();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy