Browse Source

修改相对路径

dev-DXTZYK
chenzhihang 1 year ago
parent
commit
28da9b11b8
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java

+ 4
- 2
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java View File

@@ -596,6 +596,7 @@ public class ModelsServiceImpl implements ModelsService {
String rootPath = localPath + ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName; String rootPath = localPath + ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName;
String modelPath = rootPath + "/model"; String modelPath = rootPath + "/model";
String metaPath = rootPath + "/metadata"; String metaPath = rootPath + "/metadata";
String relatePath = ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName+ "/model";


dvcUtils.gitClone(rootPath, projectUrl, branchName, gitLinkUsername, gitLinkPassword); dvcUtils.gitClone(rootPath, projectUrl, branchName, gitLinkUsername, gitLinkPassword);
dvcUtils.moveFiles(sourcePath, modelPath); dvcUtils.moveFiles(sourcePath, modelPath);
@@ -616,7 +617,7 @@ public class ModelsServiceImpl implements ModelsService {
modelMetaVo.setIdentifier(repositoryName); modelMetaVo.setIdentifier(repositoryName);
modelMetaVo.setOwner(owner); modelMetaVo.setOwner(owner);
modelMetaVo.setVersionDesc(modelMetaVo.getDescription()); modelMetaVo.setVersionDesc(modelMetaVo.getDescription());
modelMetaVo.setRelativePaths(modelPath);
modelMetaVo.setRelativePaths(relatePath);
File folder = new File(modelPath); File folder = new File(modelPath);
long folderSize = FileUtil.getFolderSize(folder); long folderSize = FileUtil.getFolderSize(folder);
modelMetaVo.setModelSize(FileUtil.formatFileSize(folderSize)); modelMetaVo.setModelSize(FileUtil.formatFileSize(folderSize));
@@ -691,6 +692,7 @@ public class ModelsServiceImpl implements ModelsService {
String rootPath = localPath + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName; String rootPath = localPath + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName;
String modelPath = rootPath + "/model"; String modelPath = rootPath + "/model";
String metaPath = rootPath + "/metadata"; String metaPath = rootPath + "/metadata";
String relatePath = ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName + "/model";


//部分信息在前面的版本里面,从那边取过来 //部分信息在前面的版本里面,从那边取过来
Map<String, Object> stringObjectMap = YamlUtils.loadYamlFile(metaPath + "/" + "metadata.yaml"); Map<String, Object> stringObjectMap = YamlUtils.loadYamlFile(metaPath + "/" + "metadata.yaml");
@@ -719,7 +721,7 @@ public class ModelsServiceImpl implements ModelsService {
modelMetaVo.setDescription(oldModelVo.getDescription()); modelMetaVo.setDescription(oldModelVo.getDescription());
modelMetaVo.setModelTag(oldModelVo.getModelTag()); modelMetaVo.setModelTag(oldModelVo.getModelTag());
modelMetaVo.setModelType(oldModelVo.getModelType()); modelMetaVo.setModelType(oldModelVo.getModelType());
modelMetaVo.setRelativePaths(modelPath);
modelMetaVo.setRelativePaths(relatePath);
File folder = new File(modelPath); File folder = new File(modelPath);
long folderSize = FileUtil.getFolderSize(folder); long folderSize = FileUtil.getFolderSize(folder);
modelMetaVo.setModelSize(FileUtil.formatFileSize(folderSize)); modelMetaVo.setModelSize(FileUtil.formatFileSize(folderSize));


Loading…
Cancel
Save