| | |
| | | @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(); |
| | | } |
| | |
| | | @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); |