From f103ac7bc4f2fbb20a0f2dd3ed97b0ac7fc5f46d Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期五, 11 四月 2025 17:40:24 +0800 Subject: [PATCH] 商家端 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 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 60dc06f..7c85c9e 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 @@ -10,6 +10,7 @@ import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.redis.annotation.DistributedLock; import com.ruoyi.other.api.domain.Goods; +import com.ruoyi.other.dto.AddGoodsDTO; import com.ruoyi.other.service.GoodsService; import com.ruoyi.other.vo.GoodsVO; import io.swagger.annotations.*; @@ -33,16 +34,20 @@ @Resource private GoodsService goodsService; + + + + /** * 添加商品 */ @PostMapping("/addGoods") @ApiOperation(value = "发布商品", tags = {"管理后台-商品管理"}) public R<Void> addGoods(@RequestBody Goods goods) { - if(goods.getPurchaseLimit()==null){ + /* if(goods.getPurchaseLimit()==null){ goods.setPurchaseLimit(-1); } - goodsService.addGoods(goods); + goodsService.addGoods(goods);*/ return R.ok(); } @@ -85,7 +90,7 @@ @PutMapping("/manageGoodsUpdate") @ApiOperation(value = "商品修改", tags = {"管理后台-商品管理"}) public R<Void> manageGoodsUpdate(@RequestBody Goods goods){ - if(goods.getPurchaseLimit()==null){ + /* if(goods.getPurchaseLimit()==null){ goods.setPurchaseLimit(-1); } goodsService.updateManageGoods(goods); @@ -98,7 +103,7 @@ goodsLambdaUpdateWrapper.set(Goods::getDistributionMode,null); goodsLambdaUpdateWrapper.eq(Goods::getId, goods.getId()); goodsService.update(goodsLambdaUpdateWrapper); - } + }*/ return R.ok(); } @@ -174,23 +179,19 @@ */ @GetMapping("/goodsDetail/{goodsId}") @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页"}) - public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId, - Integer shopId, - String longitude, - String latitude) { - return R.ok(goodsService.goodsDetail(goodsId, shopId, longitude, latitude)); + 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)); + public R<List<Goods>> getGoodsByType(){ + List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2)); return R.ok(list); } -- Gitblit v1.7.1