提交 6d13b435 authored 作者: YunaiV's avatar YunaiV

修复邮件日志 sendTime 类型不一致(应该为 LocalDateTime)

上级 5d0a1a6f
...@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service; ...@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
...@@ -65,12 +66,12 @@ public class MailLogServiceImpl implements MailLogService { ...@@ -65,12 +66,12 @@ public class MailLogServiceImpl implements MailLogService {
public void updateMailSendResult(Long logId, String messageId, Exception exception) { public void updateMailSendResult(Long logId, String messageId, Exception exception) {
// 1. 成功 // 1. 成功
if (exception == null) { if (exception == null) {
mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(new Date()) mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(LocalDateTime.now())
.setSendStatus(MailSendStatusEnum.SUCCESS.getStatus()).setSendMessageId(messageId)); .setSendStatus(MailSendStatusEnum.SUCCESS.getStatus()).setSendMessageId(messageId));
return; return;
} }
// 2. 失败 // 2. 失败
mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(new Date()) mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(LocalDateTime.now())
.setSendStatus(MailSendStatusEnum.FAILURE.getStatus()).setSendException(getRootCauseMessage(exception))); .setSendStatus(MailSendStatusEnum.FAILURE.getStatus()).setSendException(getRootCauseMessage(exception)));
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论