package com.ruoyi.order.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.order.model.OrderGood; import com.ruoyi.order.service.OrderGoodService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; /** *

* 前端控制器 *

* * @author luodangjia * @since 2024-11-21 */ @RestController @RequestMapping("/order-good") public class OrderGoodController extends BaseController { @Resource private OrderGoodService orderGoodService; /** * 查询指定商品订单 */ @PostMapping("/selectGoodsOrder") public R> selectGoodsOrder(@RequestBody List goodsIds){ startPage(); List orderGoods = orderGoodService.list(new LambdaQueryWrapper() .in(OrderGood::getGoodsId, goodsIds)); return R.ok(orderGoods); } @GetMapping("/getOrderListByUserIdAndGoodsId") public R> getOrderListByUserIdAndGoodsId(Long userId, Integer goodsId){ return R.ok(orderGoodService.getOrderListByUserIdAndGoodsId(userId, goodsId)); } }