!490 MailLogServiceImpl编译报错

Merge pull request !490 from PeterChina/master
This commit is contained in:
芋道源码 2023-05-29 13:23:52 +00:00 committed by Gitee
commit 151f659c99
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 4 additions and 3 deletions

View File

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

View File

@ -17,7 +17,7 @@ import javax.annotation.Resource;
import java.util.Map; import java.util.Map;
import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.hutool.core.util.RandomUtil.randomEle;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;