From 789cf9f3d97e58f752817c0e9ca589ff650c4734 Mon Sep 17 00:00:00 2001 From: yang <2119157836@qq.com> Date: Wed, 22 Jan 2025 16:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E5=9E=8B=E7=82=B9?= =?UTF-8?q?=E8=B5=9Ebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/resource/ModelCommentController.java | 4 ++-- .../communityCenter/mapper/QuestionCommentMapper.java | 4 ++++ .../service/impl/QuestionCommentServiceImpl.java | 7 ++----- .../com/mcwl/resource/service/impl/ModelServiceImpl.java | 9 +++++---- .../main/resources/mapper/resource/ModelLikeMapper.xml | 3 ++- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java index be291c7..0d1f003 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java @@ -43,8 +43,8 @@ public class ModelCommentController { @ApiOperation(value = "模型点赞/取消") @RepeatSubmit @GetMapping("/modelLike/{modelId}") - public AjaxResult like(@PathVariable Long imageId) { - modelLikeService.like(imageId); + public AjaxResult like(@PathVariable Long modelId) { + modelLikeService.like(modelId); return AjaxResult.success(); } diff --git a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/mapper/QuestionCommentMapper.java b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/mapper/QuestionCommentMapper.java index a09803d..d149957 100644 --- a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/mapper/QuestionCommentMapper.java +++ b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/mapper/QuestionCommentMapper.java @@ -22,4 +22,8 @@ public interface QuestionCommentMapper extends BaseMapper { Long communityId, @Param("questionId") Long questionId); + + + @InterceptorIgnore(tenantLine = "true") + QuestionComment selectByIdAndTenantIdAndCommunityIdAndQuestionIdAndCommentId(Long commentId, Long tenantId, Long communityId, Long questionId); } diff --git a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java index 0800345..6214d05 100644 --- a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java +++ b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/QuestionCommentServiceImpl.java @@ -92,8 +92,7 @@ public class QuestionCommentServiceImpl extends ServiceImpl impl imagePageRes.setOrderByColumn("create_time"); } // 设置排序 - OrderItem orderItem = OrderItem.desc(imagePageRes.getOrderByColumn()); - page.addOrder(orderItem); + List orderItemList = new ArrayList<>(); + orderItemList.add(OrderItem.desc("is_top")); + orderItemList.add(OrderItem.desc(imagePageRes.getOrderByColumn())); + page.addOrder(orderItemList); LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); - lqw.eq(imagePageRes.getStatus() != null, ModelProduct::getAuditStatus, imagePageRes.getStatus()) + lqw.eq(imagePageRes.getStatus() != null && imagePageRes.getStatus() != 0, ModelProduct::getAuditStatus, imagePageRes.getStatus()) .eq( ModelProduct::getUserId, SecurityUtils.getUserId()) .ge(imagePageRes.getStartTime() != null, ModelProduct::getCreateTime, imagePageRes.getStartTime()) .le(imagePageRes.getEndTime() != null, ModelProduct::getCreateTime, imagePageRes.getEndTime()); - postMapper.selectPage(page, lqw); // 获取分页数据 List modelImageList = page.getRecords(); diff --git a/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml b/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml index 51c3dd7..5c3f7bb 100644 --- a/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml +++ b/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml @@ -14,6 +14,7 @@ update_by, update_time, del_flag, - remark where user_id = #{userId} and model_id = #{modelId} + remark + from model_like where user_id = #{userId} and model_id = #{modelId}