处理LUJ

This commit is contained in:
fanshuai 2024-09-06 17:11:25 +08:00
parent 81366d0edd
commit 23c2bb1770
3 changed files with 13 additions and 5 deletions

View File

@ -113,7 +113,9 @@ public class NewDatasetServiceImpl implements NewDatasetService {
datasetVo.setIdentifier(repositoryName);
datasetVo.setId(gitlinIid);
datasetVo.setOwner((String) userInfo.get("login"));
if (StringUtils.isEmpty(datasetVo.getDatasetSource())){
datasetVo.setDatasetSource("用户上传");
}
YamlUtils.generateYamlFile(JsonUtils.objectToMap(datasetVo), localPath, "dataset");
// dvc init 初始化
DVCUtils.dvcInit(localPath);
@ -182,6 +184,9 @@ public class NewDatasetServiceImpl implements NewDatasetService {
datasetVo.setIdentifier(repositoryName);
datasetVo.setId(datasetVo.getId());
datasetVo.setOwner((String) userInfo.get("login"));
if (StringUtils.isEmpty(datasetVo.getDatasetSource())){
datasetVo.setDatasetSource("用户上传");
}
YamlUtils.generateYamlFile(JsonUtils.objectToMap(datasetVo), localPath, "dataset");
// dvc init 初始化
@ -269,9 +274,9 @@ public class NewDatasetServiceImpl implements NewDatasetService {
version = (String) versionList.get(0).get("name");
}
List<Map<String, Object>> fileDetailsAfterGitPull = DVCUtils.getFileDetailsAfterGitPull("E:\\test\\" +id, repositoryName, version, "data",gitLinkUsername, gitLinkPassword);
List<Map<String, Object>> fileDetailsAfterGitPull = DVCUtils.getFileDetailsAfterGitPull(localPathlocal +id, repositoryName, version, "data",gitLinkUsername, gitLinkPassword);
// 在localPathlocal+id+"/"+repositoryName目录下的dataset.yaml中取到元数据
Map<String, Object> stringObjectMap = YamlUtils.loadYamlFile("E:\\test\\" + id + "\\" + repositoryName + "\\" + "dataset.yaml");
Map<String, Object> stringObjectMap = YamlUtils.loadYamlFile(localPathlocal + id + "\\" + repositoryName + "\\" + "dataset.yaml");
NewDatasetVo newDatasetVo = ConvertUtil.convertMapToObject(stringObjectMap, NewDatasetVo.class);
List<VersionVo> versionVos = new ArrayList<VersionVo>();
if (fileDetailsAfterGitPull!=null&&fileDetailsAfterGitPull.size()>0){

View File

@ -200,14 +200,15 @@ public class DVCUtils {
// 切换到指定目录
Path repoPath = Paths.get(localPath, repoFolder, branch);
//刷新
//刷新 TODO
// gitFetch(localPath, username, password);
// // 切换到指定分支
// gitCheckoutBranch(localPath, branch);
// // 执行git pull
// gitPull(localPath, username, password);
// 读取data文件夹中的文件列表
Path dataPath = Paths.get(repoPath.toString(), filePath);
String path = localPath + "\\" + repoFolder + "\\" + filePath;
Path dataPath = Paths.get(path);
File[] files = dataPath.toFile().listFiles();
if (files != null) {

View File

@ -58,5 +58,7 @@ public class NewDatasetVo implements Serializable {
private String processingCode;
@ApiModelProperty(name = "owner",value = "项目所有者")
private String owner;
@ApiModelProperty(name = "dataset_source",value = "数据集来源")
private String datasetSource;
}