|
|
|
@@ -192,7 +192,6 @@ public class ServiceServiceImpl implements ServiceService { |
|
|
|
@Override |
|
|
|
public String runServiceVersion(Long id) { |
|
|
|
ServiceVersion serviceVersion = serviceDao.getServiceVersionById(id); |
|
|
|
ServiceVersionVo serviceVersionVo = getServiceVersionVo(serviceVersion); |
|
|
|
com.ruoyi.platform.domain.Service service = serviceDao.getServiceById(serviceVersion.getServiceId()); |
|
|
|
HashMap<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("service_name", service.getServiceName()); |
|
|
|
@@ -210,11 +209,11 @@ public class ServiceServiceImpl implements ServiceService { |
|
|
|
Map<String, Object> reqMap = JacksonUtil.parseJSONStr2Map(req); |
|
|
|
if ((Integer) reqMap.get("code") == 200) { |
|
|
|
Map<String, String> data = (Map<String, String>) reqMap.get("data"); |
|
|
|
serviceVersionVo.setUrl(data.get("url")); |
|
|
|
serviceVersionVo.setDeploymentName(data.get("deployment_name")); |
|
|
|
serviceVersionVo.setSvcName(data.get("svc_name")); |
|
|
|
serviceVersionVo.setRunState(Constant.Init); |
|
|
|
editServiceVersion(serviceVersionVo); |
|
|
|
serviceVersion.setUrl(data.get("url")); |
|
|
|
serviceVersion.setDeploymentName(data.get("deployment_name")); |
|
|
|
serviceVersion.setSvcName(data.get("svc_name")); |
|
|
|
serviceVersion.setRunState(Constant.Init); |
|
|
|
serviceDao.updateServiceVersion(serviceVersion); |
|
|
|
return "启动成功"; |
|
|
|
} else { |
|
|
|
throw new RuntimeException("启动失败"); |
|
|
|
@@ -227,13 +226,12 @@ public class ServiceServiceImpl implements ServiceService { |
|
|
|
@Override |
|
|
|
public String stopServiceVersion(Long id) { |
|
|
|
ServiceVersion serviceVersion = serviceDao.getServiceVersionById(id); |
|
|
|
ServiceVersionVo serviceVersionVo = getServiceVersionVo(serviceVersion); |
|
|
|
HashMap<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("deployment_name", serviceVersion.getDeploymentName()); |
|
|
|
String req = HttpUtils.sendPost(argoUrl + modelService + "/stop", JSON.toJSONString(paramMap)); |
|
|
|
if (StringUtils.isNotEmpty(req)) { |
|
|
|
serviceVersionVo.setRunState(Constant.Stopped); |
|
|
|
editServiceVersion(serviceVersionVo); |
|
|
|
serviceVersion.setRunState(Constant.Stopped); |
|
|
|
serviceDao.updateServiceVersion(serviceVersion); |
|
|
|
return "停止成功"; |
|
|
|
} else { |
|
|
|
throw new RuntimeException("停止失败"); |
|
|
|
|