1.
phpcjl
2024-12-06 d554bbbccd22b081452373a821fda9222e2dc0a2
1.
3个文件已修改
49 ■■■■ 已修改文件
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -92,6 +92,7 @@
    })
    @GetMapping("/writeOff/{code}")
    public R<Void> writeOff(@PathVariable("code") String code){
        // TODO 待完善
        return R.ok();
    }
@@ -104,9 +105,26 @@
    })
    @GetMapping("/cancel/{orderId}")
    public R<Void> cancel(@PathVariable("orderId") Long orderId){
        // TODO 待完善
        return R.ok();
    }
    /**
     * 确认收货
     */
    @ApiOperation(value = "确认收货", tags = {"小程序-个人中心-我的订单-确认收货"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
    })
    @GetMapping("/confirm/{orderId}")
    public R<Void> confirm(@PathVariable("orderId") Long orderId){
        // TODO 待完善
        return R.ok();
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -87,6 +87,7 @@
        Goods goods = goodsService.getById(id);
        return R.ok(goods);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
@@ -8,11 +8,10 @@
import com.ruoyi.other.api.domain.Goods;
import com.ruoyi.other.api.domain.GoodsEvaluate;
import com.ruoyi.other.service.GoodsEvaluateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@@ -27,6 +26,7 @@
 */
@RestController
@RequestMapping("/goods-evaluate")
@Api("评论")
public class GoodsEvaluateController {
    @Resource
    private GoodsEvaluateService goodsEvaluateService;
@@ -34,7 +34,7 @@
    private AppUserClient appUserClient;
    @GetMapping("/goodsList")
    @ApiOperation(value = "商品评价", tags = {"小程序-商品评价"})
    @ApiOperation(value = "获取商品评价", tags = {"小程序-获取商品评价"})
    public R<List<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId){
        List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).list();
        for (GoodsEvaluate goodsEvaluate : list) {
@@ -45,5 +45,25 @@
        return R.ok(list);
    }
    /**
     * 发布商品评价
     */
    @PostMapping("/addGoodsEvaluate")
    @ApiOperation(value = "发布商品评价", tags = {"小程序-发布商品评价"})
    public R<Void> addGoodsEvaluate(GoodsEvaluate goodsEvaluate){
        goodsEvaluateService.save(goodsEvaluate);
        return R.ok();
    }
    /**
     * 评论详情
     */
    @GetMapping("/detail/{id}")
    @ApiOperation(value = "评论详情", tags = {"小程序-评论详情"})
    public R<GoodsEvaluate> detail(@PathVariable("id") Long id){
        GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id);
        return R.ok(goodsEvaluate);
    }
}