From c48f52ec9a30857ffc0fa3bac734a9f834bb5b4d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 23 Jun 2026 06:39:10 -0700 Subject: [PATCH] feat(mall):评论详情接口 --- yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/comment/ProductCommentController.java | 10 ++++++++++ yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentService.java | 8 ++++++++ yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImpl.java | 5 +++++ 3 files changed, 23 insertions(+), 0 deletions(-) diff --git a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/comment/ProductCommentController.java b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/comment/ProductCommentController.java index 3cac6d0..5055bb9 100644 --- a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/comment/ProductCommentController.java +++ b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/comment/ProductCommentController.java @@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.product.controller.admin.comment.vo.*; import cn.iocoder.yudao.module.product.dal.dataobject.comment.ProductCommentDO; import cn.iocoder.yudao.module.product.service.comment.ProductCommentService; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import jakarta.validation.Valid; @@ -34,6 +35,15 @@ public class ProductCommentController { return success(BeanUtils.toBean(pageResult, ProductCommentRespVO.class)); } + @GetMapping("/get") + @Operation(summary = "获得商品评价") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('product:comment:query')") + public CommonResult getComment(@RequestParam("id") Long id) { + ProductCommentDO comment = productCommentService.getComment(id); + return success(BeanUtils.toBean(comment, ProductCommentRespVO.class)); + } + @PutMapping("/update-visible") @Operation(summary = "显示 / 隐藏评论") @PreAuthorize("@ss.hasPermission('product:comment:update')") diff --git a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentService.java b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentService.java index b54e219..b940340 100644 --- a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentService.java +++ b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentService.java @@ -53,6 +53,14 @@ public interface ProductCommentService { void replyComment(ProductCommentReplyReqVO replyVO, Long userId); /** + * 【管理员】获得商品评价 + * + * @param id 评价编号 + * @return 商品评价 + */ + ProductCommentDO getComment(Long id); + + /** * 【管理员】获得商品评价分页 * * @param pageReqVO 分页查询 diff --git a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImpl.java b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImpl.java index 34b0766..e6cc2f6 100644 --- a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImpl.java +++ b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImpl.java @@ -140,6 +140,11 @@ public class ProductCommentServiceImpl implements ProductCommentService { } @Override + public ProductCommentDO getComment(Long id) { + return validateCommentExists(id); + } + + @Override public PageResult getCommentPage(ProductCommentPageReqVO pageReqVO) { return productCommentMapper.selectPage(pageReqVO); } -- libgit2 0.21.4