|
|
|
@@ -2,9 +2,11 @@ package com.ruoyi.platform.controller.model; |
|
|
|
|
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult; |
|
|
|
import com.ruoyi.platform.service.ModelsService; |
|
|
|
import com.ruoyi.platform.utils.DVCUtils; |
|
|
|
import com.ruoyi.platform.vo.ModelsVo; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.eclipse.jgit.api.errors.GitAPIException; |
|
|
|
import org.springframework.core.io.InputStreamResource; |
|
|
|
import org.springframework.data.domain.PageRequest; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@@ -23,6 +26,9 @@ public class NewModelFromGitController { |
|
|
|
@Resource |
|
|
|
private ModelsService modelsService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private DVCUtils dvcUtils; |
|
|
|
|
|
|
|
@PostMapping("/addModel") |
|
|
|
@ApiOperation("添加模型") |
|
|
|
public AjaxResult addModelAndVersion(@RequestBody ModelsVo modelsVo) throws Exception { |
|
|
|
@@ -83,8 +89,8 @@ public class NewModelFromGitController { |
|
|
|
|
|
|
|
@GetMapping("/getModelDetail") |
|
|
|
@ApiOperation(value = "获取模型详细信息") |
|
|
|
public AjaxResult getModelDetail(@RequestParam("id") Integer id, @RequestParam("name") String name, @RequestParam("identifier") String identifier, @RequestParam("owner") String owner, @RequestParam("version") String version) throws Exception { |
|
|
|
return AjaxResult.success(this.modelsService.getModelDetail(id, name, identifier, owner, version)); |
|
|
|
public AjaxResult getModelDetail(@RequestParam("id") Integer id, @RequestParam("identifier") String identifier, @RequestParam("owner") String owner, @RequestParam("version") String version) throws Exception { |
|
|
|
return AjaxResult.success(this.modelsService.getModelDetail(id, identifier, owner, version)); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getModelDependencyTree") |
|
|
|
@@ -112,4 +118,16 @@ public class NewModelFromGitController { |
|
|
|
this.modelsService.deleteVersion(id, identifier, owner, version, relativePaths); |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
// @GetMapping("/test") |
|
|
|
// public AjaxResult test() { |
|
|
|
// try { |
|
|
|
// dvcUtils.gitPush("E:\\test\\admin\\model\\1451938\\object-model", "fanshuai", "h1n2x3j4y5@"); |
|
|
|
// } catch (IOException e) { |
|
|
|
// throw new RuntimeException(e); |
|
|
|
// } catch (GitAPIException e) { |
|
|
|
// throw new RuntimeException(e); |
|
|
|
// } |
|
|
|
// return AjaxResult.success(); |
|
|
|
// } |
|
|
|
} |