| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.storage.minio.utils; |
| | | |
| | | import io.minio.MinioClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @Description: |
| | | * @ClassName: MinioClientSingleton |
| | | * @Author: åèä¹ |
| | | * @Date: 2023å¹´05æ18æ¥9:32 |
| | | * @Version: 1.0 |
| | | **/ |
| | | @Slf4j(topic = "minio") |
| | | @Component |
| | | public class MinioConfig { |
| | | @Value("${minio.endpoint}") |
| | | private String endpoint; |
| | | @Value("${minio.accessKey}") |
| | | private String accessKey; |
| | | @Value("${minio.secretKey}") |
| | | private String secretKey; |
| | | |
| | | @Bean |
| | | public MinioClient getMinioClient() { |
| | | return MinioClient.builder() |
| | | .endpoint(endpoint) |
| | | .credentials(accessKey, secretKey) |
| | | .build(); |
| | | } |
| | | |
| | | } |
| | | |