From 18f26cc8b78ba47d8621ef67a9c17ae45dbb7e3f Mon Sep 17 00:00:00 2001 From: wangyu <727842003@qq.com> Date: Sun, 28 Nov 2021 19:13:34 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=A2=9E=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=AE=8C=E6=88=90=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/flyfish/framework/controller/BaseController.java | 5 +++-- .../com/flyfish/framework/service/impl/BaseServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flyfish-web/src/main/java/com/flyfish/framework/controller/BaseController.java b/flyfish-web/src/main/java/com/flyfish/framework/controller/BaseController.java index 5754e4c..ba54c96 100644 --- a/flyfish-web/src/main/java/com/flyfish/framework/controller/BaseController.java +++ b/flyfish-web/src/main/java/com/flyfish/framework/controller/BaseController.java @@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Mono; +import java.util.Arrays; import java.util.List; /** @@ -91,9 +92,9 @@ public abstract class BaseController> implemen @DeleteMapping("{id}") @Operation.Delete - public Result remove(@PathVariable String id, @CurrentUser User user) { + public Result remove(@PathVariable List id, @CurrentUser User user) { userContext.setUser(user); - service.deleteById(id); + service.deleteBatchByIds(id); return Result.ok(); } diff --git a/flyfish-web/src/main/java/com/flyfish/framework/service/impl/BaseServiceImpl.java b/flyfish-web/src/main/java/com/flyfish/framework/service/impl/BaseServiceImpl.java index 9d66666..780e987 100644 --- a/flyfish-web/src/main/java/com/flyfish/framework/service/impl/BaseServiceImpl.java +++ b/flyfish-web/src/main/java/com/flyfish/framework/service/impl/BaseServiceImpl.java @@ -255,7 +255,7 @@ public class BaseServiceImpl implements BaseService { */ @Override public void deleteBatchByIds(List ids) { - ids.forEach(id -> repository.deleteById(id)); + ids.forEach(this::deleteById); } /**