| @@ -186,7 +186,17 @@ public class ServiceServiceImpl implements ServiceService { | |||||
| public String deleteServiceVersion(Long id) { | public String deleteServiceVersion(Long id) { | ||||
| ServiceVersion serviceVersion = serviceDao.getServiceVersionById(id); | ServiceVersion serviceVersion = serviceDao.getServiceVersionById(id); | ||||
| serviceVersion.setState(Constant.State_invalid); | serviceVersion.setState(Constant.State_invalid); | ||||
| return serviceDao.updateServiceVersion(serviceVersion) > 0 ? "删除成功" : "删除失败"; | |||||
| HashMap<String, Object> paramMap = new HashMap<>(); | |||||
| paramMap.put("deployment_name", serviceVersion.getDeploymentName()); | |||||
| paramMap.put("svc_name", serviceVersion.getSvcName()); | |||||
| String req = HttpUtils.sendPost(argoUrl + modelService + "/delete", JSON.toJSONString(paramMap)); | |||||
| if (StringUtils.isNotEmpty(req)) { | |||||
| Map<String, Object> reqMap = JacksonUtil.parseJSONStr2Map(req); | |||||
| if ((Integer) reqMap.get("code") == 200) { | |||||
| return serviceDao.updateServiceVersion(serviceVersion) > 0 ? "删除成功" : "删除失败"; | |||||
| } | |||||
| } | |||||
| return "删除失败"; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -245,7 +255,7 @@ public class ServiceServiceImpl implements ServiceService { | |||||
| HashMap<String, Object> updateMap = new HashMap<>(); | HashMap<String, Object> updateMap = new HashMap<>(); | ||||
| updateMap.put("replicas", serviceVersion.getReplicas()); | updateMap.put("replicas", serviceVersion.getReplicas()); | ||||
| updateMap.put("resource", serviceVersion.getResource()); | updateMap.put("resource", serviceVersion.getResource()); | ||||
| paramMap.put("update_model", JSON.toJSONString(updateMap)); | |||||
| paramMap.put("update_model", new JSONObject(updateMap)); | |||||
| String req = HttpUtils.sendPost(argoUrl + modelService + "/update", JSON.toJSONString(paramMap)); | String req = HttpUtils.sendPost(argoUrl + modelService + "/update", JSON.toJSONString(paramMap)); | ||||
| if (StringUtils.isNotEmpty(req)) { | if (StringUtils.isNotEmpty(req)) { | ||||
| return "修改成功"; | return "修改成功"; | ||||