zhuhongyu
2025-04-16 ad59479f9664b86cca6f408614762e565cc3336d
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package tech.aiflowy.common.filestorage;
 
import tech.aiflowy.common.util.SpringContextUtil;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
 
@Configuration
@ConfigurationProperties(prefix = "aiflowy.storage")
public class StorageConfig {
 
    //支持 local、minio...
    private String type;
    /**
     * 域名
     */
    private String endpoint;
 
    /**
     * 自定义域名
     */
    private String domain;
 
    /**
     * 前缀
     */
    private String prefix;
 
    /**
     * ACCESS_KEY
     */
    private String accessKey;
 
    /**
     * SECRET_KEY
     */
    private String secretKey;
 
    /**
     * 存储空间名
     */
    private String bucketName;
 
    /**
     * 存储区域
     */
    private String region;
 
    /**
     * 是否https(1=是)
     */
    private int isHttps = 1;
 
    /**
     * 桶权限类型(0private 1public 2custom)
     */
    private int accessPolicy;
 
    public String getDomain() {
        return domain;
    }
 
    public void setDomain(String domain) {
        this.domain = domain;
    }
 
    public String getPrefix() {
        return prefix;
    }
 
    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }
 
    public String getRegion() {
        return region;
    }
 
    public void setRegion(String region) {
        this.region = region;
    }
 
    public int getIsHttps() {
        return isHttps;
    }
 
    public void setIsHttps(int isHttps) {
        this.isHttps = isHttps;
    }
 
    public int getAccessPolicy() {
        return accessPolicy;
    }
 
    public void setAccessPolicy(int accessPolicy) {
        this.accessPolicy = accessPolicy;
    }
 
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
    public String getEndpoint() {
        return endpoint;
    }
 
    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }
 
    public String getAccessKey() {
        return accessKey;
    }
 
    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }
 
    public String getSecretKey() {
        return secretKey;
    }
 
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
 
    public String getBucketName() {
        return bucketName;
    }
 
    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }
 
    public static StorageConfig getInstance(){
        return SpringContextUtil.getBean(StorageConfig.class);
    }
 
}