From e81d5ff655e0c5efc85d2e4b3803bc604baf59f1 Mon Sep 17 00:00:00 2001 From: phpcjl <phpcjl@gmail.com> Date: 星期四, 28 十一月 2024 09:57:15 +0800 Subject: [PATCH] 1.完成部分接口开发 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java index b414fac..7a6c1b9 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java @@ -1,6 +1,7 @@ package com.ruoyi.other.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.common.core.web.domain.AjaxResult; @@ -62,10 +63,19 @@ public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId){ return R.ok(goodsService.goodsDetail(goodsId)); } - - + /** + * 根据类型(1=服务商品,2=单品商品)获取商品数据 + * @param type + * @return + */ + @ResponseBody + @PostMapping("/getGoodsByType") + public R<List<Goods>> getGoodsByType(@RequestParam("type") Integer type){ + List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, type).eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2)); + return R.ok(list); + } } -- Gitblit v1.7.1