Commit 151f659c99b5488555731cfedd7bd26356724e08
Committed by
Gitee
!490 MailLogServiceImpl编译报错
Merge pull request !490 from PeterChina/master
Showing
2 changed files
with
4 additions
and
3 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImpl.java
| @@ -11,6 +11,7 @@ import org.springframework.stereotype.Service; | @@ -11,6 +11,7 @@ import org.springframework.stereotype.Service; | ||
| 11 | import org.springframework.validation.annotation.Validated; | 11 | import org.springframework.validation.annotation.Validated; |
| 12 | 12 | ||
| 13 | import javax.annotation.Resource; | 13 | import javax.annotation.Resource; |
| 14 | +import java.time.LocalDateTime; | ||
| 14 | import java.util.Date; | 15 | import java.util.Date; |
| 15 | import java.util.Map; | 16 | import java.util.Map; |
| 16 | import java.util.Objects; | 17 | import java.util.Objects; |
| @@ -65,12 +66,12 @@ public class MailLogServiceImpl implements MailLogService { | @@ -65,12 +66,12 @@ public class MailLogServiceImpl implements MailLogService { | ||
| 65 | public void updateMailSendResult(Long logId, String messageId, Exception exception) { | 66 | public void updateMailSendResult(Long logId, String messageId, Exception exception) { |
| 66 | // 1. 成功 | 67 | // 1. 成功 |
| 67 | if (exception == null) { | 68 | if (exception == null) { |
| 68 | - mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(new Date()) | 69 | + mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(LocalDateTime.now()) |
| 69 | .setSendStatus(MailSendStatusEnum.SUCCESS.getStatus()).setSendMessageId(messageId)); | 70 | .setSendStatus(MailSendStatusEnum.SUCCESS.getStatus()).setSendMessageId(messageId)); |
| 70 | return; | 71 | return; |
| 71 | } | 72 | } |
| 72 | // 2. 失败 | 73 | // 2. 失败 |
| 73 | - mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(new Date()) | 74 | + mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(LocalDateTime.now()) |
| 74 | .setSendStatus(MailSendStatusEnum.FAILURE.getStatus()).setSendException(getRootCauseMessage(exception))); | 75 | .setSendStatus(MailSendStatusEnum.FAILURE.getStatus()).setSendException(getRootCauseMessage(exception))); |
| 75 | 76 | ||
| 76 | } | 77 | } |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImplTest.java
| @@ -17,7 +17,7 @@ import javax.annotation.Resource; | @@ -17,7 +17,7 @@ import javax.annotation.Resource; | ||
| 17 | import java.util.Map; | 17 | import java.util.Map; |
| 18 | 18 | ||
| 19 | import static cn.hutool.core.util.RandomUtil.randomEle; | 19 | import static cn.hutool.core.util.RandomUtil.randomEle; |
| 20 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | 20 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; |
| 21 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | 21 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; |
| 22 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | 22 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 23 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | 23 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |