From aaa24fbe4045ed9f86dbefacb5e7440d1d5227bb Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Sat, 23 Dec 2023 14:34:30 +0800
Subject: [PATCH] 评论bug修复

---
 src/main/java/org/springblade/modules/article/controller/ArticleCommentController.java    |    4 ++++
 src/main/java/org/springblade/modules/article/service/impl/ArticleCommentServiceImpl.java |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/springblade/modules/article/controller/ArticleCommentController.java b/src/main/java/org/springblade/modules/article/controller/ArticleCommentController.java
index 3fb3aab..c6ceea0 100644
--- a/src/main/java/org/springblade/modules/article/controller/ArticleCommentController.java
+++ b/src/main/java/org/springblade/modules/article/controller/ArticleCommentController.java
@@ -10,7 +10,9 @@
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.AesUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.article.entity.ArticleCommentEntity;
 import org.springblade.modules.article.service.IArticleCommentService;
@@ -72,6 +74,7 @@
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入articleComment")
 	public R save(@Valid @RequestBody ArticleCommentEntity articleComment) {
+		articleComment.setUserId(AuthUtil.getUserId());
 		return R.status(articleCommentService.save(articleComment));
 	}
 
@@ -92,6 +95,7 @@
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入articleComment")
 	public R submit(@Valid @RequestBody ArticleCommentEntity articleComment) {
+		articleComment.setUserId(AuthUtil.getUserId());
 		return R.status(articleCommentService.saveOrUpdate(articleComment));
 	}
 
diff --git a/src/main/java/org/springblade/modules/article/service/impl/ArticleCommentServiceImpl.java b/src/main/java/org/springblade/modules/article/service/impl/ArticleCommentServiceImpl.java
index 4e1057a..f966b67 100644
--- a/src/main/java/org/springblade/modules/article/service/impl/ArticleCommentServiceImpl.java
+++ b/src/main/java/org/springblade/modules/article/service/impl/ArticleCommentServiceImpl.java
@@ -18,6 +18,7 @@
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.modules.article.entity.ArticleCommentEntity;
 import org.springblade.modules.article.mapper.ArticleCommentMapper;
 import org.springblade.modules.article.service.IArticleCommentService;
@@ -35,6 +36,7 @@
 
 	@Override
 	public IPage<ArticleCommentVO> selectArticleCommentPage(IPage<ArticleCommentVO> page, ArticleCommentVO noticeComment) {
+		noticeComment.setUserId(AuthUtil.getUserId());
 		return page.setRecords(baseMapper.selectArticleCommentPage(page, noticeComment));
 	}
 

--
Gitblit v1.9.3