|
|
@ -3,6 +3,19 @@ package com.fanruan.boot.env; |
|
|
|
import com.fanruan.carina.annotions.ActivatorRefer; |
|
|
|
import com.fanruan.carina.annotions.ActivatorRefer; |
|
|
|
import com.fanruan.carina.annotions.DependsOn; |
|
|
|
import com.fanruan.carina.annotions.DependsOn; |
|
|
|
import com.fanruan.carina.annotions.FineComponent; |
|
|
|
import com.fanruan.carina.annotions.FineComponent; |
|
|
|
|
|
|
|
import com.fanruan.carina.annotions.Start; |
|
|
|
|
|
|
|
import com.fanruan.messenger.ums.config.email.FineEmailSecurityProviderImpl; |
|
|
|
|
|
|
|
import com.fr.base.email.EmailCenter; |
|
|
|
|
|
|
|
import com.fr.base.email.impl.EmailAccountManagerImpl; |
|
|
|
|
|
|
|
import com.fr.base.email.impl.FREmailDispatcherImpl; |
|
|
|
|
|
|
|
import com.fr.base.email.impl.FineEmailExtensionProviderImpl; |
|
|
|
|
|
|
|
import com.fr.base.email.impl.FineEmailResourceProviderImpl; |
|
|
|
|
|
|
|
import com.fr.base.email.provider.FineEmailExtensionProvider; |
|
|
|
|
|
|
|
import com.fr.base.email.provider.FineEmailResourceProvider; |
|
|
|
|
|
|
|
import com.fr.base.email.provider.config.FineEmailServerConfigProvider; |
|
|
|
|
|
|
|
import com.fr.base.email.task.EmailTaskManagement; |
|
|
|
|
|
|
|
import com.fr.config.EmailServerConfig; |
|
|
|
|
|
|
|
import com.fr.decision.webservice.v10.sms.SMSService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设计器基础功能组件,环境切换的上层模块 |
|
|
|
* 设计器基础功能组件,环境切换的上层模块 |
|
|
@ -27,4 +40,48 @@ import com.fanruan.carina.annotions.FineComponent; |
|
|
|
@FineComponent(name = "design_function") |
|
|
|
@FineComponent(name = "design_function") |
|
|
|
@DependsOn(dependencies = {"design_function_analyzer"}) |
|
|
|
@DependsOn(dependencies = {"design_function_analyzer"}) |
|
|
|
public class DesignFunctionComponent { |
|
|
|
public class DesignFunctionComponent { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Start |
|
|
|
|
|
|
|
public void start() { |
|
|
|
|
|
|
|
// 通知中心目前是不支持的,但是可以先开个邮件的接口出来
|
|
|
|
|
|
|
|
initEmail(); |
|
|
|
|
|
|
|
initSMS(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initEmail() { |
|
|
|
|
|
|
|
FineEmailExtensionProvider fineEmailExtensionProvider = new FineEmailExtensionProviderImpl(); |
|
|
|
|
|
|
|
FineEmailResourceProvider fineEmailResourceProvider = new FineEmailResourceProviderImpl(); |
|
|
|
|
|
|
|
EmailCenter.init(new FineEmailServerConfigProvider() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int getSmtpConnectionTimeout() { |
|
|
|
|
|
|
|
return EmailServerConfig.getInstance().getSmtpConnectionTimeout(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int getSmtpTimeout() { |
|
|
|
|
|
|
|
return EmailServerConfig.getInstance().getSmtpTimeout(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int getSmtpWriteTimeout() { |
|
|
|
|
|
|
|
return EmailServerConfig.getInstance().getSmtpWriteTimeout(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean isDebugEnable() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fineEmailExtensionProvider, fineEmailResourceProvider, |
|
|
|
|
|
|
|
new FineEmailSecurityProviderImpl()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmailCenter.setDispatcher(new FREmailDispatcherImpl()); |
|
|
|
|
|
|
|
EmailCenter.setAccountManager(new EmailAccountManagerImpl()); |
|
|
|
|
|
|
|
EmailTaskManagement.getInstance().start(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initSMS() { |
|
|
|
|
|
|
|
SMSService.getInstance().registerTemplateId(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|