liusuyi
2025-09-06 bb508127e9454e8b39ac7d431765b6de0ac74c35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.ard.tianyu.component.minio.config;
 
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.minio.MinioClient;
 
/**
 * Minio 配置信息
 *
 * @author ruoyi
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MinioConfig {
 
    /**
     * 服务地址
     */
    private String url;
 
    /**
     * 用户名
     */
    private String accessKey;
 
    /**
     * 密码
     */
    private String secretKey;
 
    /**
     * 存储桶名称
     */
    private String bucketName;
 
 
    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder().endpoint(url).credentials(accessKey, secretKey).build();
    }
}