🎨 调整邮件发送状态值
This commit is contained in:
@@ -12,6 +12,8 @@ import java.time.LocalDate;
|
||||
*/
|
||||
@Data
|
||||
public class MailDTO {
|
||||
public static final String MAIL_DELIMITER =",";
|
||||
|
||||
/**
|
||||
* 发件人
|
||||
*/
|
||||
@@ -49,9 +51,9 @@ public class MailDTO {
|
||||
*/
|
||||
private LocalDate sentDate;
|
||||
/**
|
||||
* 发送状态 1:成功 2:失败
|
||||
* 是否发送成功
|
||||
*/
|
||||
private Integer status;
|
||||
private Boolean success;
|
||||
/**
|
||||
* 错误信息 errorMsg
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MailSenderImpl implements MailSender {
|
||||
/**
|
||||
* 发送邮件
|
||||
*
|
||||
* @param mailDTO
|
||||
* @param mailDTO 邮件参数
|
||||
*/
|
||||
@Override
|
||||
public void sendMail(MailDTO mailDTO) {
|
||||
@@ -43,9 +43,9 @@ public class MailSenderImpl implements MailSender {
|
||||
checkMail(mailDTO);
|
||||
//2.发送邮件
|
||||
sendMimeMail(mailDTO);
|
||||
mailDTO.setStatus(1);
|
||||
mailDTO.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
mailDTO.setStatus(2);
|
||||
mailDTO.setSuccess(false);
|
||||
mailDTO.setErrorMsg(e.getMessage());
|
||||
log.error("发送邮件失败:", e);
|
||||
}finally {
|
||||
@@ -57,7 +57,7 @@ public class MailSenderImpl implements MailSender {
|
||||
|
||||
/**
|
||||
* 构建复杂邮件信息类
|
||||
* @param mailDTO
|
||||
* @param mailDTO 邮件发送设置
|
||||
*/
|
||||
private void sendMimeMail(MailDTO mailDTO) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user