forked from github/dataease
fix: 增加接口校验
This commit is contained in:
parent
2213a565f8
commit
9cc43d1095
@ -42,7 +42,7 @@ public class DataSetGroupController {
|
|||||||
}, logical = Logical.AND)
|
}, logical = Logical.AND)
|
||||||
@ApiOperation("保存")
|
@ApiOperation("保存")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public DataSetGroupDTO save(@RequestBody DatasetGroup datasetGroup) {
|
public DataSetGroupDTO save(@RequestBody DatasetGroup datasetGroup) throws Exception {
|
||||||
return dataSetGroupService.save(datasetGroup);
|
return dataSetGroupService.save(datasetGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,10 @@ public class DataSetGroupService {
|
|||||||
private SysAuthService sysAuthService;
|
private SysAuthService sysAuthService;
|
||||||
|
|
||||||
@DeCleaner(DePermissionType.DATASET)
|
@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);
|
checkName(datasetGroup);
|
||||||
if (StringUtils.isEmpty(datasetGroup.getId())) {
|
if (StringUtils.isEmpty(datasetGroup.getId())) {
|
||||||
datasetGroup.setId(UUID.randomUUID().toString());
|
datasetGroup.setId(UUID.randomUUID().toString());
|
||||||
@ -65,7 +68,7 @@ public class DataSetGroupService {
|
|||||||
public void delete(String id) throws Exception {
|
public void delete(String id) throws Exception {
|
||||||
|
|
||||||
Assert.notNull(id, "id cannot be null");
|
Assert.notNull(id, "id cannot be null");
|
||||||
sysAuthService.checkTreeNoManageCount("dataset",id);
|
sysAuthService.checkTreeNoManageCount("dataset", id);
|
||||||
|
|
||||||
DatasetGroup dg = datasetGroupMapper.selectByPrimaryKey(id);
|
DatasetGroup dg = datasetGroupMapper.selectByPrimaryKey(id);
|
||||||
DataSetGroupRequest datasetGroup = new DataSetGroupRequest();
|
DataSetGroupRequest datasetGroup = new DataSetGroupRequest();
|
||||||
|
Loading…
Reference in New Issue
Block a user