xiejun
2024-11-01 80b6cbfc9c861469146318d0b3dd5f8b8b525b8a
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
package org.springblade.core.boot.props;
 
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
 
/**
 * BladeFileProperties
 *
 * @author Chill
 */
@Getter
@Setter
@ConfigurationProperties("blade.file")
public class BladeFileProperties {
 
    /**
     * 远程上传模式
     */
    private boolean remoteMode = false;
 
    /**
     * 外网地址
     */
    private String uploadDomain = "http://127.0.0.1:8999";
 
    /**
     * 上传下载路径(物理路径)
     */
    private String remotePath = System.getProperty("user.dir") + "/target/blade";
 
    /**
     * 上传路径(相对路径)
     */
    private String uploadPath = "/upload";
 
    /**
     * 下载路径
     */
    private String downloadPath = "/download";
 
    /**
     * 图片压缩
     */
    private Boolean compress = false;
 
    /**
     * 图片压缩比例
     */
    private Double compressScale = 2.00;
 
    /**
     * 图片缩放选择:true放大;false缩小
     */
    private Boolean compressFlag = false;
 
    /**
     * 项目物理路径
     */
    private String realPath = System.getProperty("user.dir");
 
    /**
     * 项目相对路径
     */
    private String contextPath = "/";
 
 
    public String getUploadRealPath() {
        return (remoteMode ? remotePath : realPath) + uploadPath;
    }
 
    public String getUploadCtxPath() {
        return contextPath + uploadPath;
    }
 
}