From 2ef96ad31bc67292e25b9c5fa248765db1939e09 Mon Sep 17 00:00:00 2001 From: Parker Date: Tue, 15 Sep 2020 20:09:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=8F=92=E4=BB=B6=E6=94=B9?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/mail/{MailHandler.java => MailPlugin.java} | 2 +- .../{MailException.java => MailPluginException.java} | 6 +++--- .../handler/{MailHandlerImpl.java => MailPlugInImpl.java} | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/{MailHandler.java => MailPlugin.java} (91%) rename opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/exception/{MailException.java => MailPluginException.java} (68%) rename opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/handler/{MailHandlerImpl.java => MailPlugInImpl.java} (89%) diff --git a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/MailHandler.java b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/MailPlugin.java similarity index 91% rename from opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/MailHandler.java rename to opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/MailPlugin.java index cd9c525..d3df2c2 100644 --- a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/MailHandler.java +++ b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/MailPlugin.java @@ -9,7 +9,7 @@ import org.opsli.plugins.mail.model.MailModel; * @CreateTime: 2020-09-13 18:51 * @Description: 邮件执行器 */ -public interface MailHandler { +public interface MailPlugin { /** * 发送邮件 diff --git a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/exception/MailException.java b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/exception/MailPluginException.java similarity index 68% rename from opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/exception/MailException.java rename to opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/exception/MailPluginException.java index 5edff0a..37e617b 100644 --- a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/exception/MailException.java +++ b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/exception/MailPluginException.java @@ -10,13 +10,13 @@ import org.opsli.common.exception.ServiceException; * @CreateTime: 2020-09-13 18:44 * @Description: 邮件异常 */ -public class MailException extends ServiceException { +public class MailPluginException extends ServiceException { - public MailException(Integer code, String errorMessage) { + public MailPluginException(Integer code, String errorMessage) { super(code, errorMessage); } - public MailException(BaseMsg msg) { + public MailPluginException(BaseMsg msg) { super(msg); } } diff --git a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/handler/MailHandlerImpl.java b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/handler/MailPlugInImpl.java similarity index 89% rename from opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/handler/MailHandlerImpl.java rename to opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/handler/MailPlugInImpl.java index 099e237..7653a75 100644 --- a/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/handler/MailHandlerImpl.java +++ b/opsli-plugins/opsli-plugins-mail/src/main/java/org/opsli/plugins/mail/handler/MailPlugInImpl.java @@ -3,8 +3,8 @@ package org.opsli.plugins.mail.handler; import cn.hutool.core.lang.Validator; import lombok.extern.slf4j.Slf4j; import org.opsli.common.exception.EmptyException; -import org.opsli.plugins.mail.MailHandler; -import org.opsli.plugins.mail.exception.MailException; +import org.opsli.plugins.mail.MailPlugin; +import org.opsli.plugins.mail.exception.MailPluginException; import org.opsli.plugins.mail.model.MailModel; import org.opsli.plugins.mail.msg.MailMsg; import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +24,7 @@ import javax.mail.internet.MimeMessage; */ @Slf4j @Service -public class MailHandlerImpl implements MailHandler { +public class MailPlugInImpl implements MailPlugin { @Value("${spring.mail.username}") private String username; @@ -44,7 +44,7 @@ public class MailHandlerImpl implements MailHandler { javaMailSender.send(message); } catch (Exception e) { log.error("邮件发送异常:{}",e.getMessage()); - throw new MailException(MailMsg.EXCEPTION_UNKNOWN); + throw new MailPluginException(MailMsg.EXCEPTION_UNKNOWN); } log.info("邮件发送 - 发送至:{} - 主题:{}", mailModel.getTo(),mailModel.getSubject()); }