springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java
@@ -11,6 +11,7 @@ import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; import com.panzhihua.common.model.vos.shop.*; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.validated.AddGroup; import com.panzhihua.common.validated.PutGroup; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -60,11 +61,34 @@ } @ApiOperation(value = "查询商品详情", response = ComShopFlowerGoodsVO.class) @PostMapping("shopGoodsDetail") @GetMapping("shopGoodsDetail") @ApiImplicitParam(name = "goodsId", value = "商品id", required = true) public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) { return communityService.shopFlowerGoodsDetail(goodsId); } @ApiOperation(value = "删除商品") @DeleteMapping("/goods/delete") public R deleteShopGoods(@RequestParam("goodsId") Long goodsId) { return communityService.deleteFlowerShopGoods(goodsId); } @ApiOperation(value = "商品上下架") @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "商品Id"), @ApiImplicitParam(name = "status", value = "1.上架 2.下架 ")}) @GetMapping("/goods/changeStatus") public R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) { return communityService.changeFlowerStatus(id, status); } @ApiOperation(value = "编辑商品") @PostMapping("/goods/edit/{id}") public R editShopGoods(@PathVariable("id") Long id, @RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) { return communityService.editFlowerShopGoods(id, addShopGoodsVO); } @ApiOperation(value = "新增商品") @PostMapping("/goods/save") public R saveShopGoods(@RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) { return communityService.saveFlowerShopGoods(addShopGoodsVO); } @ApiOperation(value = "查询用户收货地址列表", response = ComShopUserAddressVO.class) @PostMapping("shopUserAddressList") springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -2974,11 +2974,11 @@ /** * 删除商品 * * @param id * @param goodsId * @return */ @PostMapping("/shopFlower/deleteShopGoods") R deleteFlowerShopGoods(@RequestBody Long[] id); @DeleteMapping("/shopFlower/deleteShopGoods") R deleteFlowerShopGoods(@RequestParam("goodsId") Long goodsId); /** * 修改商品状态 @@ -2990,12 +2990,12 @@ R changeFlowerStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status); /** * 修改商品状态 * 商品详情 * * @param goodsId * @return */ @PostMapping("/shopFlower/shopGoodsDetail") @GetMapping("/shopFlower/shopGoodsDetail") R shopFlowerGoodsDetail(@RequestParam("goodsId") Long goodsId); springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java
@@ -72,7 +72,7 @@ return communityService.editFlowerShopGoods(id, addShopGoodsVO); } @ApiOperation(value = "查询商品详情", response = ComShopFlowerGoodsVO.class) @PostMapping("shopGoodsDetail") @GetMapping("shopGoodsDetail") @ApiImplicitParam(name = "goodsId", value = "商品id", required = true) public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) { return communityService.shopFlowerGoodsDetail(goodsId); @@ -80,9 +80,9 @@ @ApiOperation(value = "删除商品") @PostMapping("/goods/delete") public R deleteShopGoods(@RequestBody Long[] id) { return communityService.deleteFlowerShopGoods(id); @DeleteMapping("/goods/delete") public R deleteShopGoods(@RequestParam("goodsId") Long goodsId) { return communityService.deleteFlowerShopGoods(goodsId); } @ApiOperation(value = "商品上下架") springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java
@@ -85,12 +85,12 @@ /** * 删除商品 * * @param id * @param goodsId * @return */ @PostMapping("deleteShopGoods") public R deleteFlowerShopGoods(@RequestBody Long[] id) { return comShopFlowerGoodsService.deleteShopFlowerGoods(id); @DeleteMapping("deleteShopGoods") public R deleteFlowerShopGoods(@RequestParam("goodsId") Long goodsId) { return comShopFlowerGoodsService.deleteShopFlowerGoods(goodsId); } /** @@ -99,7 +99,7 @@ * @param goodsId 商品id * @return 商品信息 */ @PostMapping("shopGoodsDetail") @GetMapping("shopGoodsDetail") public R shopFlowerGoodsDetail(@RequestParam("goodsId") Long goodsId) { return comShopFlowerGoodsService.shopFlowerGoodsDetail(goodsId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerGoodsService.java
@@ -70,7 +70,7 @@ * @param id * @return */ R deleteShopFlowerGoods(Long[] id); R deleteShopFlowerGoods(Long id); /** * 修改商品状态 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java
@@ -131,6 +131,7 @@ for (ComShopFlowerGoodsAttrDO oneGoodsAttrDO : goodsAttrDOs) { AddShopFlowerGoodsAttrVO goodsAttrVO = new AddShopFlowerGoodsAttrVO(); BeanUtils.copyProperties(oneGoodsAttrDO, goodsAttrVO); goodsAttrVO.setGoodsAttrId(oneGoodsAttrDO.getId()); goodsAttrVOList.add(goodsAttrVO); } shopGoods.setGoodsAttrs(goodsAttrVOList); @@ -283,13 +284,10 @@ } @Override public R deleteShopFlowerGoods(Long[] id) { LambdaQueryWrapper<ComShopFlowerGoodsDO> query = new LambdaQueryWrapper<ComShopFlowerGoodsDO>().in(ComShopFlowerGoodsDO::getId, id); List<ComShopFlowerGoodsDO> comShopGoodsDOS = this.baseMapper.selectList(query); for (ComShopFlowerGoodsDO one : comShopGoodsDOS) { one.setDeleteStatus(ComShopFlowerGoodsDO.deleteStatus.yes); this.baseMapper.updateById(one); } public R deleteShopFlowerGoods(Long id) { ComShopFlowerGoodsDO comShopFlowerGoodsDO = this.baseMapper.selectById(id); comShopFlowerGoodsDO.setDeleteStatus(ComShopFlowerGoodsDO.deleteStatus.yes); this.baseMapper.updateById(comShopFlowerGoodsDO); return R.ok(); }