Parcourir la source

Merge remote-tracking branch 'origin/master'

lwhhszx il y a 1 an
Parent
commit
a79c9bd291

+ 7 - 3
src/main/java/cn/cslg/pas/controller/ProductCategoryController.java

@@ -85,10 +85,14 @@ public class ProductCategoryController {
 
     @Operation(summary = "删除产品类别")
     @PostMapping("/deleteProductCategory")
-    public String deleteProductCategory(@RequestBody List<Integer> ids) throws Exception {
+    public Response deleteProductCategory(@RequestBody List<Integer> ids) throws Exception {
         Business business = businessFactory.getClass("productCategoryService");
-        business.deleteMessage(ids);
-        return Response.success();
+        try {
+            business.deleteMessage(ids);
+        } catch (Exception e) {
+            return Response.error(e.getMessage());
+        }
+        return Response.success(1);
     }
 
 }