| | |
| | | public Result update(@RequestBody @Valid PurchasingUpdateModel updateModel){ |
| | | Purchasing purchasing= purchasingService.getById(updateModel.getId()); |
| | | if (purchasing==null){ |
| | | throw new YamiShopBindException("参数错误!"); |
| | | throw new YamiShopBindException("Invalid parameters!"); |
| | | } |
| | | BeanUtils.copyProperties(updateModel,purchasing); |
| | | purchasingService.updateById(purchasing); |
| | |
| | | public Result delete(@RequestBody @Valid IdModel idModel){ |
| | | Purchasing purchasing= purchasingService.getById(idModel.getId()); |
| | | if (purchasing==null){ |
| | | throw new YamiShopBindException("参数错误!"); |
| | | throw new YamiShopBindException("Invalid parameters!"); |
| | | } |
| | | purchasingService.removeById(purchasing); |
| | | return Result.ok(null); |