cloudroam
2025-03-10 c306cba52bcc3e2c423f77d4a52c35ad04c52038
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
package com.jsh.erp.config;
 
import com.gitee.starblues.integration.DefaultIntegrationConfiguration;
import org.pf4j.RuntimeMode;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
 
/**
 * @Description:
 * @Author: jishenghua
 * @Version: 1.0
 * @Create Date Time: 2019-05-25 12:36
 * @Update Date Time:
 * @see
 */
@Component
@ConfigurationProperties(prefix = "plugin")
public class PluginConfiguration extends DefaultIntegrationConfiguration {
 
    /**
     * 运行模式
     *  开发环境: development、dev
     *  生产/部署 环境: deployment、prod
     */
    @Value("${runMode:dev}")
    private String runMode;
 
    @Value("${pluginPath:plugins}")
    private String pluginPath;
 
    @Value("${pluginConfigFilePath:pluginConfigs}")
    private String pluginConfigFilePath;
 
    @Override
    public RuntimeMode environment() {
        return RuntimeMode.byName(runMode);
    }
 
    @Override
    public String pluginPath() {
        return pluginPath;
    }
 
    @Override
    public String pluginConfigFilePath() {
        return pluginConfigFilePath;
    }
 
    @Override
    public String uploadTempPath() {
        return "temp";
    }
 
    @Override
    public String backupPath() {
        return "backupPlugin";
    }
 
    @Override
    public String pluginRestControllerPathPrefix() {
        return "/api/plugin";
    }
 
    @Override
    public boolean enablePluginIdRestControllerPathPrefix() {
        return true;
    }
 
    public String getRunMode() {
        return runMode;
    }
 
    public void setRunMode(String runMode) {
        this.runMode = runMode;
    }
 
 
    public String getPluginPath() {
        return pluginPath;
    }
 
    public void setPluginPath(String pluginPath) {
        this.pluginPath = pluginPath;
    }
 
    public String getPluginConfigFilePath() {
        return pluginConfigFilePath;
    }
 
    public void setPluginConfigFilePath(String pluginConfigFilePath) {
        this.pluginConfigFilePath = pluginConfigFilePath;
    }
 
    @Override
    public String toString() {
        return "PluginArgConfiguration{" +
                "runMode='" + runMode + '\'' +
                ", pluginPath='" + pluginPath + '\'' +
                ", pluginConfigFilePath='" + pluginConfigFilePath + '\'' +
                '}';
    }
}