|
@@ -15,6 +15,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
public class WorkProConfig{
|
|
|
private static WorkProConfig INSTANCE = null;
|
|
|
|
|
|
+ private boolean enable;
|
|
|
+
|
|
|
private String url;
|
|
|
|
|
|
private String appid;
|
|
@@ -39,6 +41,8 @@ public class WorkProConfig{
|
|
|
if(INSTANCE == null){
|
|
|
INSTANCE = new WorkProConfig();
|
|
|
SystemProperties instance = SystemProperties.getInstance();
|
|
|
+ INSTANCE.setEnable(
|
|
|
+ Boolean.TRUE.toString().equalsIgnoreCase(instance.getProperty("workpro.enable")));
|
|
|
INSTANCE.setUrl(instance.getProperty("workpro.url"));
|
|
|
INSTANCE.setAppid(instance.getProperty("workpro.appid"));
|
|
|
INSTANCE.setAppSecret(instance.getProperty("workpro.appSecret"));
|
|
@@ -52,8 +56,9 @@ public class WorkProConfig{
|
|
|
return INSTANCE;
|
|
|
}
|
|
|
|
|
|
- public boolean isEnable(){
|
|
|
- return StringUtils.isNoneEmpty(this.url, this.appid, this.appSecret, this.userId, this.account, this.password);
|
|
|
+ public boolean enable(){
|
|
|
+ return this.enable && StringUtils.isNoneEmpty(this.url, this.appid, this.appSecret, this.userId, this.account,
|
|
|
+ this.password);
|
|
|
}
|
|
|
|
|
|
}
|