diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java index e8ec07bd..cab9ed4e 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java @@ -144,4 +144,10 @@ public class ProductController { public boolean saveProductModel(@Validated @RequestBody Request bo) { return productService.editProductModel(bo.getData()); } + + @PostMapping("/productModel/delete") + @ApiOperation("删除产品型号") + public boolean deleteProductModel(@Validated @RequestBody Request id) { + return productService.deleteProductModel(id.getData()); + } } diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java index ed73e269..7bf6c457 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java @@ -48,4 +48,6 @@ public interface IProductService { List getModels(String productKey); boolean editProductModel(ProductModelBo productModel); + + boolean deleteProductModel(String id); } diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java index b5af47a0..5df308ff 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java @@ -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);