|
|
|
@@ -12,6 +12,9 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("newdataset") |
|
|
|
//@Api(value = "新数据集管理") |
|
|
|
@@ -92,6 +95,11 @@ public class NewDatasetFromGitController { |
|
|
|
@DeleteMapping("/deleteDatasetVersion") |
|
|
|
@ApiOperation(value = "删除数据集版本") |
|
|
|
public AjaxResult deleteDatasetVersion(@RequestParam("identifier") String repo,@RequestParam("owner")String owner,@RequestParam("version")String version) throws Exception { |
|
|
|
// 查询版本,如果是最后一个版本,则不能删除 |
|
|
|
List<Map<String, Object>> versionList = this.newDatasetService.getVersionList(repo, owner); |
|
|
|
if(versionList.size() == 1){ |
|
|
|
return AjaxResult.error("当前数据集只有一个版本,不能删除该版本"); |
|
|
|
} |
|
|
|
this.newDatasetService.deleteDatasetVersionNew(repo,owner,version); |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
|