2026-06-30 24681c81c09022f584a57006f2534b5f74723414
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.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 @@
        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<ProductCommentRespVO> 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')")