luodangjia
2025-01-14 b83f20fd0d9be4ed0dbba7f22f82f71b839044eb
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);