fix:物模型型号配置添加删除接口

V0.5.x
tangfudong 2023-06-21 17:29:25 +08:00
parent eb5c8c2872
commit 0994c7f1c9
3 changed files with 14 additions and 0 deletions

View File

@ -144,4 +144,10 @@ public class ProductController {
public boolean saveProductModel(@Validated @RequestBody Request<ProductModelBo> bo) {
return productService.editProductModel(bo.getData());
}
@PostMapping("/productModel/delete")
@ApiOperation("删除产品型号")
public boolean deleteProductModel(@Validated @RequestBody Request<String> id) {
return productService.deleteProductModel(id.getData());
}
}

View File

@ -48,4 +48,6 @@ public interface IProductService {
List<ProductModelVo> getModels(String productKey);
boolean editProductModel(ProductModelBo productModel);
boolean deleteProductModel(String id);
}

View File

@ -199,6 +199,12 @@ public class ProductServiceImpl implements IProductService {
}
@Override
public boolean deleteProductModel(String id) {
productModelData.deleteById(id);
return true;
}
@Override
public boolean editProductModel(ProductModelBo productModelBo) {
ProductModel productModel = productModelBo.to(ProductModel.class);