From a4d39035922cb86a29c50fb5361adf1b272ca39e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 9 Jul 2024 18:05:09 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-126559=20=E6=8E=A7=E4=BB=B6=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=BC=96=E8=BE=91=E9=9D=A2=E6=9D=BF=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 + .../boot/env/DesignFunctionComponent.java | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/build.gradle b/build.gradle index b9595e53e8..ac1e875184 100644 --- a/build.gradle +++ b/build.gradle @@ -90,6 +90,7 @@ allprojects { implementation 'com.fr.license:fine-license-api:' + apiVersion implementation 'com.fr.workplace:workplace:' + apiVersion implementation 'com.fr.cluster:fine-cluster-api:' + apiVersion + implementation 'com.fr.messenger:fine-messenger:' + carinaVersion implementation 'com.install4j:install4j-runtime:8.0.4' implementation 'com.fr.third:jxbrowser:6.23' implementation 'com.fr.third:jxbrowser-v7:7.22' diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/DesignFunctionComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/DesignFunctionComponent.java index 43837f18e1..a7c33f5d83 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/DesignFunctionComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/DesignFunctionComponent.java @@ -3,6 +3,19 @@ package com.fanruan.boot.env; import com.fanruan.carina.annotions.ActivatorRefer; import com.fanruan.carina.annotions.DependsOn; 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") @DependsOn(dependencies = {"design_function_analyzer"}) 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(); + } + }