From 5728732f45cc45f3c5cbde0abe7a7c5efee605b9 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期一, 09 十二月 2024 15:31:05 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java index 52be078..a7e2962 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java @@ -1,13 +1,13 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.common.core.domain.R; -import com.ruoyi.common.core.web.page.TableDataInfo; -import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.GoodsEvaluate; import com.ruoyi.other.service.GoodsEvaluateService; +import com.ruoyi.other.vo.GoodsEvaluateVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -50,19 +50,21 @@ */ @PostMapping("/addGoodsEvaluate") @ApiOperation(value = "发布商品评价", tags = {"小程序-发布商品评价"}) - public R<Void> addGoodsEvaluate(GoodsEvaluate goodsEvaluate){ - goodsEvaluateService.save(goodsEvaluate); + public R<Void> addGoodsEvaluate(@RequestBody GoodsEvaluateVO goodsEvaluateVO){ + goodsEvaluateService.addGoodsEvaluate(goodsEvaluateVO); return R.ok(); } /** * 评论详情 */ - @GetMapping("/detail/{id}") + @GetMapping("/detail/{orderId}") @ApiOperation(value = "评论详情", tags = {"小程序-评论详情"}) - public R<GoodsEvaluate> detail(@PathVariable("id") Long id){ - GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); - return R.ok(goodsEvaluate); + public R<List<GoodsEvaluate>> detail(@PathVariable("orderId") Long orderId){ + List<GoodsEvaluate> list = goodsEvaluateService.list(new LambdaQueryWrapper<GoodsEvaluate>() + .eq(GoodsEvaluate::getStatus, 2) + .eq(GoodsEvaluate::getOrderId, orderId)); + return R.ok(list); } } -- Gitblit v1.7.1