提交 cae9f1dc authored 作者: 孙洁清's avatar 孙洁清

Merge branch 'master' of git.yfzx.zjtys.com.cn:912-system/monitor/inspect

......@@ -125,7 +125,7 @@ public class InspectController {
@PostMapping("/git")
@ApiOperation("git下载代码进行评估")
public ResponseEntity inspect1(@RequestBody InspectParameter inspectParameter) {
String path = GitLabUtil.downLoadProject(inspectParameter.getGitAddress(), inspectParameter.getGitName());
String path = GitLabUtil.downLoadProject(inspectParameter.getGitAddress());
inspectParameter.setId(UUIDUtil.getUUID());
inspectParameter.setSourceAddress(path);
ReportVo reportVo = new ReportVo();
......@@ -389,4 +389,9 @@ public class InspectController {
return ResponseEntity.ok("上传失败");
}
}
@PostMapping("/gitdownload")
private ResponseEntity gitDownloads(String gitAddress){
String gitPath = GitLabUtil.downLoadProject(gitAddress);
return ResponseEntity.ok(gitPath);
}
}
......@@ -5,7 +5,9 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* <h4>Description : 应用系统改造替换表单</h4>
......@@ -103,7 +105,7 @@ public class Reform {
/**
* 该应用类型
*/
private Integer applicationType = -1;
private List<Integer> applicationType = new ArrayList<>();
/**
* 运行时间
......
......@@ -16,13 +16,13 @@ import java.time.LocalDate;
@Component
public class GitLabUtil {
public static String downLoadProject(String path,String name) {
public static String downLoadProject(String path) {
String name1 = LocalDate.now().toString();
String[] split1 = UUIDUtil.getUUID().split("-");
//String REMOTE_URL = "https://git.yfzx.zjtys.com.cn:8888/912-system/monitor/adaptation-master.git";
CloneCommand cloneCommand = Git.cloneRepository();
cloneCommand.setURI(path);
File file = new File("./"+name1+"/"+split1[0]+"/"+name);
File file = new File("./"+name1+"/"+split1[0]+"/");
file.mkdirs();
cloneCommand.setDirectory(file);
try {
......@@ -38,6 +38,11 @@ public class GitLabUtil {
return file.getAbsolutePath();
}
public static void main(String[] args) {
String hostsss = GitLabUtil.downLoadProject("https://git.yfzx.zjtys.com.cn/912-system/monitor/inspect.git");
System.out.println(hostsss);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论