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 | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 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 0420a93..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 @@ -85,8 +85,8 @@ //自我认证 if (MyConstant.myIds.contains(addDto.getVisitorNickName())) { - if (StrUtil.isEmpty(addDto.getAuthCode()) || !addDto.getAuthCode().equals(ConstantContextHolder.getAuthCode())) { - throw new BlogException("不要成为我,你就是真的自己"); + if (StrUtil.isEmpty(addDto.getAuthCode()) || !addDto.getAuthCode().equals(ConstantContextHolder.getPushCode())) { + throw new BlogException("此名称在这里使用需要正确的授权码.."); } } @@ -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