From 904d55b53c7838949acdfc920059b2cf8497a16b Mon Sep 17 00:00:00 2001 From: linfeng <2445465217@qq.com> Date: Sat, 7 Oct 2023 07:34:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E7=B1=BB=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/service/impl/CategoryServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/linfeng/modules/admin/service/impl/CategoryServiceImpl.java b/src/main/java/io/linfeng/modules/admin/service/impl/CategoryServiceImpl.java index d14bc11..6c62580 100644 --- a/src/main/java/io/linfeng/modules/admin/service/impl/CategoryServiceImpl.java +++ b/src/main/java/io/linfeng/modules/admin/service/impl/CategoryServiceImpl.java @@ -64,7 +64,10 @@ public class CategoryServiceImpl extends ServiceImpl 0) { throw new LinfengException("分类名不能重复"); } - this.save(category); + boolean save = this.save(category); + if(!save){ + throw new LinfengException("分类保存失败"); + } } /** @@ -86,6 +89,7 @@ public class CategoryServiceImpl extends ServiceImpl 1) { throw new LinfengException("分类名不能重复"); } - this.updateById(category); + boolean update = this.updateById(category); + if(!update){ + throw new LinfengException("分类更新失败"); + } }