Browse Source

优化转换流水线失败判断

pull/221/head
chenzhihang 6 months ago
parent
commit
ea31f2f830
4 changed files with 22 additions and 0 deletions
  1. +5
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java
  2. +4
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java
  3. +7
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/MachineLearnServiceImpl.java
  4. +6
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/RayServiceImpl.java

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

@@ -157,6 +157,11 @@ public class ActiveLearnServiceImpl implements ActiveLearnService {
throw new RuntimeException("转换流水线失败");
}
Map<String, Object> converMap = JsonUtils.jsonToMap(convertRes);
String convertResData = (String) converMap.get("data");
if (StringUtils.isEmpty(convertResData)) {
throw new RuntimeException("转换流水线失败");
}

// 组装运行接口json
Map<String, Object> output = (Map<String, Object>) converMap.get("output");
Map<String, Object> runReqMap = new HashMap<>();


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

@@ -237,6 +237,10 @@ public class ExperimentServiceImpl implements ExperimentService {
throw new Exception("转换流水线失败");
}
Map<String, Object> converMap = JsonUtils.jsonToMap(convertRes);
String convertResData = (String) converMap.get("data");
if (StringUtils.isEmpty(convertResData)) {
throw new RuntimeException("转换流水线失败");
}

// 判断积分和资源是否足够
Map<String, Map<String, Object>> resourceInfo = (Map<String, Map<String, Object>>) converMap.get("resource_info");


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

@@ -165,6 +165,13 @@ public class MachineLearnServiceImpl implements MachineLearnService {
if (convertRes == null || StringUtils.isEmpty(convertRes)) {
throw new RuntimeException("转换流水线失败");
}

Map<String, Object> convertResMap = JsonUtils.jsonToMap(convertRes);
String convertResData = (String) convertResMap.get("data");
if (StringUtils.isEmpty(convertResData)) {
throw new RuntimeException("转换流水线失败");
}

Map<String, Object> converMap = JsonUtils.jsonToMap(convertRes);
// 组装运行接口json
Map<String, Object> output = (Map<String, Object>) converMap.get("output");


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

@@ -175,7 +175,13 @@ public class RayServiceImpl implements RayService {
if (convertRes == null || StringUtils.isEmpty(convertRes)) {
throw new RuntimeException("转换流水线失败");
}

Map<String, Object> converMap = JsonUtils.jsonToMap(convertRes);
String convertResData = (String) converMap.get("data");
if (StringUtils.isEmpty(convertResData)) {
throw new RuntimeException("转换流水线失败");
}

// 组装运行接口json
Map<String, Object> output = (Map<String, Object>) converMap.get("output");
Map<String, Object> runReqMap = new HashMap<>();


Loading…
Cancel
Save