Browse Source

修复创建数据集版本重复bug

dev-complex-computation
chenzhihang 1 year ago
parent
commit
a19db5a968
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

+ 8
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java View File

@@ -179,6 +179,14 @@ public class NewDatasetServiceImpl implements NewDatasetService {
}

public String newCreateVersion(NewDatasetVo datasetVo) throws Exception {
List<Map<String, Object>> versionList = getVersionList(datasetVo.getIdentifier(), datasetVo.getOwner());
for (Map<String, Object> versionMap : versionList) {
String version = (String) versionMap.get("name");
if (version.equals(datasetVo.getVersion())) {
throw new Exception("版本已存在");
}
}

String token = gitService.checkoutToken();
Jedis jedis = new Jedis(redisHost, redisPort);
LoginUser loginUser = SecurityUtils.getLoginUser();


Loading…
Cancel
Save