From 9cc43d10955e159a6a94c2edb077bb9502d966a2 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 28 Mar 2022 15:51:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dataset/DataSetGroupController.java | 2 +- .../io/dataease/service/dataset/DataSetGroupService.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/dataset/DataSetGroupController.java b/backend/src/main/java/io/dataease/controller/dataset/DataSetGroupController.java index 876c7ab312..c16047128f 100644 --- a/backend/src/main/java/io/dataease/controller/dataset/DataSetGroupController.java +++ b/backend/src/main/java/io/dataease/controller/dataset/DataSetGroupController.java @@ -42,7 +42,7 @@ public class DataSetGroupController { }, logical = Logical.AND) @ApiOperation("保存") @PostMapping("/save") - public DataSetGroupDTO save(@RequestBody DatasetGroup datasetGroup) { + public DataSetGroupDTO save(@RequestBody DatasetGroup datasetGroup) throws Exception { return dataSetGroupService.save(datasetGroup); } diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java index c7144d4129..c6b833306b 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java @@ -44,7 +44,10 @@ public class DataSetGroupService { private SysAuthService sysAuthService; @DeCleaner(DePermissionType.DATASET) - public DataSetGroupDTO save(DatasetGroup datasetGroup) { + public DataSetGroupDTO save(DatasetGroup datasetGroup) throws Exception { + if (StringUtils.isEmpty(datasetGroup.getType())) { + throw new Exception("type can not be empty"); + } checkName(datasetGroup); if (StringUtils.isEmpty(datasetGroup.getId())) { datasetGroup.setId(UUID.randomUUID().toString()); @@ -65,7 +68,7 @@ public class DataSetGroupService { public void delete(String id) throws Exception { Assert.notNull(id, "id cannot be null"); - sysAuthService.checkTreeNoManageCount("dataset",id); + sysAuthService.checkTreeNoManageCount("dataset", id); DatasetGroup dg = datasetGroupMapper.selectByPrimaryKey(id); DataSetGroupRequest datasetGroup = new DataSetGroupRequest();