From ea6bf9042d9ad4faaf328bdc68a41ef36b47f13d Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期二, 14 一月 2025 20:09:55 +0800
Subject: [PATCH] 12.18
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 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 4fd3c4b..b4b019b 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
@@ -48,6 +48,9 @@
@PostMapping("/addGoods")
@ApiOperation(value = "发布商品", tags = {"管理后台-商品管理"})
public R<Void> addGoods(@RequestBody Goods goods) {
+ if(goods.getPurchaseLimit()==null){
+ goods.setPurchaseLimit(-1);
+ }
goodsService.addGoods(goods);
return R.ok();
}
@@ -78,6 +81,9 @@
@PutMapping("/manageGoodsUpdate")
@ApiOperation(value = "商品修改", tags = {"管理后台-商品管理"})
public R<Void> manageGoodsUpdate(@RequestBody Goods goods){
+ if(goods.getPurchaseLimit()==null){
+ goods.setPurchaseLimit(-1);
+ }
goodsService.updateManageGoods(goods);
if (goods.getType()==2){
goods.setAppointStore(2);
@@ -173,11 +179,14 @@
*/
@GetMapping("/goodsDetail/{goodsId}")
@ApiOperation(value = "商品详情", tags = {"小程序-商城-首页"})
- public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId, String longitude, String latitude){
- return R.ok(goodsService.goodsDetail(goodsId, longitude, latitude));
+ public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId,
+ Integer shopId,
+ String longitude,
+ String latitude) {
+ return R.ok(goodsService.goodsDetail(goodsId, shopId, longitude, latitude));
}
-
-
+
+
/**
* 根据类型(1=服务商品,2=单品商品)获取商品数据
* @param type
@@ -189,8 +198,8 @@
List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, type).eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2));
return R.ok(list);
}
-
-
+
+
/**
* 根据id获取商品信息
* @param id
--
Gitblit v1.7.1