邮件插件改名

v1.4.1
Parker 4 years ago
parent 9f7556922b
commit 2ef96ad31b

@ -9,7 +9,7 @@ import org.opsli.plugins.mail.model.MailModel;
* @CreateTime: 2020-09-13 18:51
* @Description:
*/
public interface MailHandler {
public interface MailPlugin {
/**
*

@ -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);
}
}

@ -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());
}
Loading…
Cancel
Save