From aae48957ba971ed0a1bfbfa182701cd22bbe8694 Mon Sep 17 00:00:00 2001
From: inleft <inleft@qq.com>
Date: Wed, 31 Aug 2022 18:12:16 +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