提交 9cc43d10 authored 作者: junjun's avatar junjun

fix: 增加接口校验

上级 2213a565
......@@ -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);
}
......
......@@ -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();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论