From 7fe1bd7734e8a1f80523d5fce34290e3f20a7403 Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Sun, 21 Aug 2022 21:09:23 +0800 Subject: [PATCH] 新增邮件消息自提醒 --- snowy-main/src/main/java/vip/xiaonuo/modular/blogarticlecomment/controller/BlogArticleCommentOutsideController.java | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticlecomment/controller/BlogArticleCommentOutsideController.java b/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticlecomment/controller/BlogArticleCommentOutsideController.java index c36d3ed..19c483c 100644 --- a/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticlecomment/controller/BlogArticleCommentOutsideController.java +++ b/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticlecomment/controller/BlogArticleCommentOutsideController.java @@ -131,6 +131,14 @@ return new SuccessResponseData(); } + //发送者是我本体,标记回复该条回复消息已读 + if (MyConstant.myIds.contains(addDto.getVisitorNickName())) { + commentService.lambdaUpdate() + .eq(BlogArticleComment::getId, lastComment.getId()) + .set(BlogArticleComment::getIsRead, MyConstant.Yes) + .update(); + } + //前一个留言接收邮件回复(如果是给评论者自己的追加可以跳过) if (MyConstant.Yes.equals(lastComment.getIsReceiveCallback()) && StrUtil.isNotEmpty(lastComment.getVisitorEmail()) @@ -138,9 +146,6 @@ // && !lastComment.getVisitorEmail().equals(MyConstant.email) && !lastComment.getVisitorNickName().equals(addDto.getVisitorNickName()) && !lastComment.getVisitorEmail().equals(addDto.getVisitorEmail())) { - - TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("templates", TemplateConfig.ResourceMode.CLASSPATH)); - Template template = engine.getTemplate("emailReplyModel.ftl"); String title = MyConstant.msgTitle; String address; @@ -154,6 +159,9 @@ title = checkArticle.getTitle(); } + TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig(MyConstant.ftlModel.path, TemplateConfig.ResourceMode.CLASSPATH)); + Template template = engine.getTemplate(MyConstant.ftlModel.reply); + Dict dict = Dict.create() .set("lastGuest", lastComment.getVisitorNickName()) .set("commentContent", lastComment.getCommentContent()) -- Gitblit v1.9.1