package com.gci.boot.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
public class MinioConfig {
    @Value("${minio.minioUrl}")
    private String minioUrl;
    @Value("${minio.minioName}")
    private String minioName;
    @Value("${minio.minioPass}")
    private String minioPass;

    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder()
                .endpoint(minioUrl)
                .credentials(minioName,minioPass).build();
    }
}
