package com.ruoyi.im.minioConfig;

import com.ruoyi.im.props.MinioProperties;
import io.minio.MinioClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class MinIoClientConfig {

    @Bean
    public MinioClient minioClient(MinioProperties minioProps) {
        // 注入minio 客户端
        return MinioClient.builder()
            .endpoint(minioProps.getEndpoint())
            .credentials(minioProps.getAccessKey(), minioProps.getSecretKey())
            .build();
    }
}
