zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
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
package org.jeecg.modules.doc.component;
 
import lombok.Data;
import org.jeecg.modules.doc.util.UFOPUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
 
@Component
@RefreshScope
@Data
public class UfopConfig {
 
    @Value(value = "${ufop.local-storage-path}")
    private String localStoragePath;
 
    @Value(value = "${ufop.bucket-name}")
    private String bucketName;
 
    @Value(value = "${ufop.release-path}")
    private String releasePath;
 
    @Value(value = "${ufop.thumb-image.width}")
    private Double thumbImageWidth;
 
    @Value(value = "${ufop.thumb-image.height}")
    private Double thumbImageHeight;
 
    @Value(value="${ufop.encrypt-path}")
    private String encryptPath;
 
 
    @Bean
    public void initStatic(){
        UFOPUtils.LOCAL_STORAGE_PATH = this.getLocalStoragePath();
        UFOPUtils.ROOT_PATH = this.getBucketName()==null||"".equals(this.getBucketName())? "upload" : this.getBucketName();
        UFOPUtils.ENCRYPT_PATH = this.getEncryptPath();
    }
 
 
}