feat: 采纳评论修复

master
yang 2025-01-23 13:36:47 +08:00
parent f5309a6759
commit 999616a0cd
3 changed files with 9 additions and 1 deletions

View File

@ -74,7 +74,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 1440
expireTime: 43200
# MyBatis Plus配置
mybatis-plus:

View File

@ -113,6 +113,11 @@ public class QuestionCommentServiceImpl extends ServiceImpl<QuestionCommentMappe
return AjaxResult.error("该评论已被采纳");
}
Long questionUserId = question.getQuestionUserId();
if (questionComment.getUserId().equals(questionUserId)) {
return AjaxResult.error("您不能采纳自己的评论");
}
questionComment.setIsAccept(1);
baseMapper.updateById(questionComment);

View File

@ -14,6 +14,7 @@
question_url,
is_anonymous,
amount,
status,
type
from cc_question
where del_flag = '0'
@ -30,6 +31,7 @@
question_url,
is_anonymous,
amount,
status,
type
from cc_question
where id = #{id}
@ -46,6 +48,7 @@
question_url,
is_anonymous,
amount,
status,
type
from cc_question
where del_flag = '0'