Browse Source

改造为可配置使用代理服务器

dev-DXTZYK
fanshuai 1 year ago
parent
commit
d87b013ed6
8 changed files with 43 additions and 44 deletions
  1. +4
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AimServiceImpl.java
  2. +5
    -3
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java
  3. +5
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentServiceImpl.java
  4. +13
    -12
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/GitServiceImpl.java
  5. +4
    -3
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java
  6. +4
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java
  7. +4
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/WorkflowServiceImpl.java
  8. +4
    -12
      ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml

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

@@ -1,14 +1,12 @@
package com.ruoyi.platform.service.impl; package com.ruoyi.platform.service.impl;


import com.ruoyi.platform.domain.ExperimentIns; import com.ruoyi.platform.domain.ExperimentIns;
import com.ruoyi.platform.domain.ModelDependency;
import com.ruoyi.platform.service.AimService; import com.ruoyi.platform.service.AimService;
import com.ruoyi.platform.service.ExperimentInsService; import com.ruoyi.platform.service.ExperimentInsService;
import com.ruoyi.platform.service.ModelDependencyService;
import com.ruoyi.platform.utils.AIM64EncoderUtil; import com.ruoyi.platform.utils.AIM64EncoderUtil;
import com.ruoyi.platform.utils.HttpUtils;
import com.ruoyi.platform.utils.JacksonUtil; import com.ruoyi.platform.utils.JacksonUtil;
import com.ruoyi.platform.utils.JsonUtils; import com.ruoyi.platform.utils.JsonUtils;
import com.ruoyi.platform.utils.NewHttpUtils;
import com.ruoyi.platform.vo.InsMetricInfoVo; import com.ruoyi.platform.vo.InsMetricInfoVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -28,6 +26,8 @@ public class AimServiceImpl implements AimService {
private String aimUrl; private String aimUrl;
@Value("${aim.proxyUrl}") @Value("${aim.proxyUrl}")
private String aimProxyUrl; private String aimProxyUrl;
@Resource
private NewHttpUtils httpUtils;


@Override @Override
public List<InsMetricInfoVo> getExpTrainInfos(Integer experimentId) throws Exception { public List<InsMetricInfoVo> getExpTrainInfos(Integer experimentId) throws Exception {
@@ -52,7 +52,7 @@ public class AimServiceImpl implements AimService {
} }
String encodedUrlString = URLEncoder.encode("run.experiment==\""+experimentName+"\"", "UTF-8"); String encodedUrlString = URLEncoder.encode("run.experiment==\""+experimentName+"\"", "UTF-8");
String url = aimProxyUrl+"/api/runs/search/run?query="+encodedUrlString; String url = aimProxyUrl+"/api/runs/search/run?query="+encodedUrlString;
String s = HttpUtils.sendGetRequest(url);
String s = httpUtils.sendGet(url,null);
List<Map<String, Object>> response = JacksonUtil.parseJSONStr2MapList(s); List<Map<String, Object>> response = JacksonUtil.parseJSONStr2MapList(s);
System.out.println("response: "+JacksonUtil.toJSONString(response)); System.out.println("response: "+JacksonUtil.toJSONString(response));
if (response == null || response.size() == 0){ if (response == null || response.size() == 0){


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

@@ -56,6 +56,8 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {
@Value("${minio.endpoint}") @Value("${minio.endpoint}")
private String minioEndpoint; private String minioEndpoint;
@Resource @Resource
private NewHttpUtils httpUtils;
@Resource
private K8sClientUtil k8sClientUtil; private K8sClientUtil k8sClientUtil;
private final MinioUtil minioUtil; private final MinioUtil minioUtil;
public ExperimentInsServiceImpl(MinioUtil minioUtil) { public ExperimentInsServiceImpl(MinioUtil minioUtil) {
@@ -263,7 +265,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {


try { try {
// 发送POST请求到Argo工作流状态查询接口,并将请求数据转换为JSON // 发送POST请求到Argo工作流状态查询接口,并将请求数据转换为JSON
String req = HttpUtils.sendPost(argoUrl + argoWorkflowStatus, JsonUtils.mapToJson(res));
String req = httpUtils.sendPost(argoUrl + argoWorkflowStatus,null, JsonUtils.mapToJson(res));
// 检查响应是否为空或无内容 // 检查响应是否为空或无内容
if (req == null || StringUtils.isEmpty(req)) { if (req == null || StringUtils.isEmpty(req)) {
throw new RuntimeException("工作流状态响应为空。"); throw new RuntimeException("工作流状态响应为空。");
@@ -357,7 +359,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {


try { try {
// 发送POST请求到Argo工作流状态查询接口,并将请求数据转换为JSON // 发送POST请求到Argo工作流状态查询接口,并将请求数据转换为JSON
String req = HttpUtils.sendPost(argoUrl + argoWorkflowTermination, JsonUtils.mapToJson(res));
String req = httpUtils.sendPost(argoUrl + argoWorkflowTermination,null, JsonUtils.mapToJson(res));
// 检查响应是否为空或无内容 // 检查响应是否为空或无内容
if (StringUtils.isEmpty(req)) { if (StringUtils.isEmpty(req)) {
throw new RuntimeException("终止响应内容为空。"); throw new RuntimeException("终止响应内容为空。");
@@ -415,7 +417,7 @@ public class ExperimentInsServiceImpl implements ExperimentInsService {


try { try {
// 发送POST请求到Argo工作流日志查询接口,并将请求数据转换为JSON // 发送POST请求到Argo工作流日志查询接口,并将请求数据转换为JSON
String req = HttpUtils.sendPost(argoUrl + argoWorkflowLog, JsonUtils.mapToJson(res));
String req = httpUtils.sendPost(argoUrl + argoWorkflowLog, null,JsonUtils.mapToJson(res));
// 检查响应是否为空或无内容 // 检查响应是否为空或无内容
if (StringUtils.isEmpty(req)) { if (StringUtils.isEmpty(req)) {
throw new RuntimeException("响应内容为空"); throw new RuntimeException("响应内容为空");


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

@@ -8,9 +8,9 @@ import com.ruoyi.platform.domain.dependencydomain.TrainTaskDepency;
import com.ruoyi.platform.mapper.ExperimentDao; import com.ruoyi.platform.mapper.ExperimentDao;
import com.ruoyi.platform.mapper.ExperimentInsDao; import com.ruoyi.platform.mapper.ExperimentInsDao;
import com.ruoyi.platform.service.*; import com.ruoyi.platform.service.*;
import com.ruoyi.platform.utils.HttpUtils;
import com.ruoyi.platform.utils.JacksonUtil; import com.ruoyi.platform.utils.JacksonUtil;
import com.ruoyi.platform.utils.JsonUtils; import com.ruoyi.platform.utils.JsonUtils;
import com.ruoyi.platform.utils.NewHttpUtils;
import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.api.model.LoginUser;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -55,7 +55,8 @@ public class ExperimentServiceImpl implements ExperimentService {
@Resource @Resource
@Lazy @Lazy
private ExperimentInsService experimentInsService; private ExperimentInsService experimentInsService;

@Resource
private NewHttpUtils httpUtils;
@Value("${argo.url}") @Value("${argo.url}")
private String argoUrl; private String argoUrl;
@Value("${argo.convert}") @Value("${argo.convert}")
@@ -222,7 +223,7 @@ public class ExperimentServiceImpl implements ExperimentService {
String dag = workflow.getDag(); String dag = workflow.getDag();
// 调argo转换接口 // 调argo转换接口
try { try {
String convertRes = HttpUtils.sendPost(argoUrl + argoConvert, dag);
String convertRes = httpUtils.sendPost(argoUrl + argoConvert,null, dag);
if (convertRes == null || StringUtils.isEmpty(convertRes)) { if (convertRes == null || StringUtils.isEmpty(convertRes)) {
throw new RuntimeException("转换流水线失败"); throw new RuntimeException("转换流水线失败");
} }
@@ -241,7 +242,7 @@ public class ExperimentServiceImpl implements ExperimentService {


Map<String ,Object> output = (Map<String, Object>) converMap.get("output"); Map<String ,Object> output = (Map<String, Object>) converMap.get("output");
// 调argo运行接口 // 调argo运行接口
String runRes = HttpUtils.sendPost(argoUrl + argoWorkflowRun, JsonUtils.mapToJson(runReqMap));
String runRes = httpUtils.sendPost(argoUrl + argoWorkflowRun,null, JsonUtils.mapToJson(runReqMap));


if (runRes == null || StringUtils.isEmpty(runRes)) { if (runRes == null || StringUtils.isEmpty(runRes)) {
throw new RuntimeException("Failed to run workflow."); throw new RuntimeException("Failed to run workflow.");


+ 13
- 12
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/GitServiceImpl.java View File

@@ -2,9 +2,9 @@ package com.ruoyi.platform.service.impl;


import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.platform.service.GitService; import com.ruoyi.platform.service.GitService;
import com.ruoyi.platform.utils.HttpUtils;
import com.ruoyi.platform.utils.JacksonUtil; import com.ruoyi.platform.utils.JacksonUtil;
import com.ruoyi.platform.utils.JsonUtils; import com.ruoyi.platform.utils.JsonUtils;
import com.ruoyi.platform.utils.NewHttpUtils;
import com.ruoyi.platform.vo.GitProjectVo; import com.ruoyi.platform.vo.GitProjectVo;
import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.api.model.LoginUser;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -16,9 +16,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis; import redis.clients.jedis.Jedis;


import javax.annotation.Resource;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -32,7 +32,8 @@ public class GitServiceImpl implements GitService {
private Integer redisPort; private Integer redisPort;
@Value("${git.endpoint}") @Value("${git.endpoint}")
String gitendpoint; String gitendpoint;

@Resource
private NewHttpUtils httpUtils;
private static final Logger log = LoggerFactory.getLogger(GitServiceImpl.class); private static final Logger log = LoggerFactory.getLogger(GitServiceImpl.class);


@Override @Override
@@ -46,7 +47,7 @@ public class GitServiceImpl implements GitService {
params.put("client_secret", "L3wBKTNnRo-wPen7bxR3F1myCvtVDgpWa6MnpfyWeJE"); params.put("client_secret", "L3wBKTNnRo-wPen7bxR3F1myCvtVDgpWa6MnpfyWeJE");
try { try {
// 发送POST请求 // 发送POST请求
String req = HttpUtils.sendPostRequest(gitendpoint + "/oauth/token", null, JsonUtils.mapToJson(params));
String req = httpUtils.sendPost(gitendpoint + "/oauth/token", null,JsonUtils.mapToJson(params));
// 解析响应JSON // 解析响应JSON
if (StringUtils.isEmpty(req)) { if (StringUtils.isEmpty(req)) {
throw new RuntimeException("终止响应内容为空。"); throw new RuntimeException("终止响应内容为空。");
@@ -58,7 +59,7 @@ public class GitServiceImpl implements GitService {
String accessToken = (String) runResMap.get("access_token"); String accessToken = (String) runResMap.get("access_token");


//通过access_token获取用户信息 //通过access_token获取用户信息
String userReq = HttpUtils.sendGetWithToken(gitendpoint + "/api/users/get_user_info.json", null, accessToken);
String userReq = httpUtils.sendGetWithToken(gitendpoint + "/api/users/get_user_info.json", null, accessToken);
if (StringUtils.isEmpty(userReq)) { if (StringUtils.isEmpty(userReq)) {
throw new RuntimeException("终止响应内容为空。"); throw new RuntimeException("终止响应内容为空。");
} }
@@ -103,7 +104,7 @@ public class GitServiceImpl implements GitService {


@Override @Override
public Map createProject(String token,GitProjectVo gitProjectVo) throws Exception { public Map createProject(String token,GitProjectVo gitProjectVo) throws Exception {
String userReq = HttpUtils.sendPostWithToken(gitendpoint + "/api/projects.json", JsonUtils.objectToJson(gitProjectVo), token);
String userReq = httpUtils.sendPostWithToken(gitendpoint + "/api/projects.json",null, token,JsonUtils.objectToJson(gitProjectVo));
return JsonUtils.jsonToMap(userReq); return JsonUtils.jsonToMap(userReq);
} }


@@ -118,7 +119,7 @@ public class GitServiceImpl implements GitService {
Map<String, Object> resMap = new HashMap<>(); Map<String, Object> resMap = new HashMap<>();
resMap.put("new_branch_name", branchName); resMap.put("new_branch_name", branchName);
resMap.put("old_branch_name", oldBranchName); resMap.put("old_branch_name", oldBranchName);
String req = HttpUtils.sendPostWithToken(createBranchUrl, JsonUtils.objectToJson(resMap), token);
String req = httpUtils.sendPostWithToken(createBranchUrl, null, token,JsonUtils.objectToJson(resMap));
System.out.println(req); System.out.println(req);
} }


@@ -128,12 +129,12 @@ public class GitServiceImpl implements GitService {
Map<String, Object> resMap = new HashMap<>(); Map<String, Object> resMap = new HashMap<>();
resMap.put("project_id", id); resMap.put("project_id", id);
resMap.put("name", topicName); resMap.put("name", topicName);
String req = HttpUtils.sendPostWithToken(gitendpoint + "/api/v1/project_topics.json", JsonUtils.objectToJson(resMap), token);
String req = httpUtils.sendPostWithToken(gitendpoint + "/api/v1/project_topics.json",null, token ,JsonUtils.objectToJson(resMap));
} }


@Override @Override
public List<Map<String, Object>> getBrancheList(String token,String owner, String projectName) throws Exception { public List<Map<String, Object>> getBrancheList(String token,String owner, String projectName) throws Exception {
String req = HttpUtils.sendGetWithToken(gitendpoint + "/api/v1/" + owner + "/" + projectName + "/branches/all.json", null, token);
String req = httpUtils.sendGetWithToken(gitendpoint + "/api/v1/" + owner + "/" + projectName + "/branches/all.json", null, token);
// 解析响应JSON // 解析响应JSON
if (StringUtils.isEmpty(req)) { if (StringUtils.isEmpty(req)) {
throw new RuntimeException("终止响应内容为空。"); throw new RuntimeException("终止响应内容为空。");
@@ -145,7 +146,7 @@ public class GitServiceImpl implements GitService {


@Override @Override
public void deleteProject(String token,String owner, String projectName) throws Exception { public void deleteProject(String token,String owner, String projectName) throws Exception {
HttpUtils.sendDeleteRequest(gitendpoint + "/api/" + owner + "/" + projectName + ".json", token);
httpUtils.sendDeleteWithToken(gitendpoint + "/api/" + owner + "/" + projectName + ".json", null, token);
} }


@Override @Override
@@ -156,12 +157,12 @@ public class GitServiceImpl implements GitService {
} catch (IOException | GitAPIException e) { } catch (IOException | GitAPIException e) {
log.error("Exception occurred while creating local branch based on master",e); log.error("Exception occurred while creating local branch based on master",e);
} }
HttpUtils.sendDeleteRequest(gitendpoint + "/api/v1/" + owner + "/" + projectName + "/branches/" + branchName + ".json", token);
httpUtils.sendDeleteWithToken(gitendpoint + "/api/v1/" + owner + "/" + projectName + "/branches/" + branchName + ".json", null, token);
} }


@Override @Override
public Map getUserInfo(String token) throws Exception { public Map getUserInfo(String token) throws Exception {
String userReq = HttpUtils.sendGetWithToken(gitendpoint + "/api/users/get_user_info.json",null, token);
String userReq = httpUtils.sendGetWithToken(gitendpoint + "/api/users/get_user_info.json",null, token);
if (StringUtils.isEmpty(userReq)){ if (StringUtils.isEmpty(userReq)){
return null; return null;
} }


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

@@ -76,7 +76,8 @@ public class ModelsServiceImpl implements ModelsService {


@Resource @Resource
private AssetIconService assetIconService; private AssetIconService assetIconService;

@Resource
private NewHttpUtils httpUtils;


// 固定存储桶名 // 固定存储桶名
@Value("${minio.dataReleaseBucketName}") @Value("${minio.dataReleaseBucketName}")
@@ -845,7 +846,7 @@ public class ModelsServiceImpl implements ModelsService {
url = url + "&search=" + name; url = url + "&search=" + name;
} }


String req = HttpUtils.sendGetWithToken(url, null, token);
String req = httpUtils.sendGetWithToken(url, null, token);
Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req); Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req);
Integer total = (Integer) stringObjectMap.get("count"); Integer total = (Integer) stringObjectMap.get("count");
List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects"); List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects");
@@ -876,7 +877,7 @@ public class ModelsServiceImpl implements ModelsService {
url = url + "&search=" + name; url = url + "&search=" + name;
} }


String req = HttpUtils.sendGetWithToken(url, null, token);
String req = httpUtils.sendGetWithToken(url, null, token);
Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req); Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req);
Integer total = (Integer) stringObjectMap.get("total_count"); Integer total = (Integer) stringObjectMap.get("total_count");
List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects"); List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects");


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

@@ -63,6 +63,8 @@ public class NewDatasetServiceImpl implements NewDatasetService {
@Value("${git.localPath}") @Value("${git.localPath}")
String localPathlocal; String localPathlocal;
@Resource @Resource
private NewHttpUtils httpUtils;
@Resource
private DatasetTempStorageService datasetTempStorageService; private DatasetTempStorageService datasetTempStorageService;
@Override @Override
public String newCreateDataset(NewDatasetVo datasetVo) throws Exception { public String newCreateDataset(NewDatasetVo datasetVo) throws Exception {
@@ -236,7 +238,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
if (StringUtils.isNotEmpty(name)){ if (StringUtils.isNotEmpty(name)){
url =url + "&search=" + name; url =url + "&search=" + name;
} }
String req = HttpUtils.sendGetWithToken(url, null, token);
String req = httpUtils.sendGetWithToken(url, null, token);
Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req); Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req);
Integer total = (Integer) stringObjectMap.get("count"); Integer total = (Integer) stringObjectMap.get("count");
List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects"); List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects");
@@ -264,7 +266,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
url =url + "&search=" + name; url =url + "&search=" + name;
} }


String req = HttpUtils.sendGetWithToken(url, null, token);
String req = httpUtils.sendGetWithToken(url, null, token);
Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req); Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req);
Integer total = (Integer) stringObjectMap.get("total_count"); Integer total = (Integer) stringObjectMap.get("total_count");
List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects"); List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects");


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

@@ -2,15 +2,14 @@ package com.ruoyi.platform.service.impl;


import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.platform.annotations.CheckDuplicate; import com.ruoyi.platform.annotations.CheckDuplicate;
import com.ruoyi.platform.domain.Dataset;
import com.ruoyi.platform.domain.Experiment; import com.ruoyi.platform.domain.Experiment;
import com.ruoyi.platform.domain.Workflow; import com.ruoyi.platform.domain.Workflow;
import com.ruoyi.platform.mapper.WorkflowDao; import com.ruoyi.platform.mapper.WorkflowDao;
import com.ruoyi.platform.service.ExperimentService; import com.ruoyi.platform.service.ExperimentService;
import com.ruoyi.platform.service.WorkflowService; import com.ruoyi.platform.service.WorkflowService;
import com.ruoyi.platform.utils.HttpUtils;
import com.ruoyi.platform.utils.JsonUtils; import com.ruoyi.platform.utils.JsonUtils;
import com.ruoyi.platform.utils.MinioUtil; import com.ruoyi.platform.utils.MinioUtil;
import com.ruoyi.platform.utils.NewHttpUtils;
import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.api.model.LoginUser;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -45,7 +44,8 @@ public class WorkflowServiceImpl implements WorkflowService {


@Value("${argo.workflowCopy}") @Value("${argo.workflowCopy}")
private String argoWorkflowCopy; private String argoWorkflowCopy;

@Resource
private NewHttpUtils httpUtils;
private final MinioUtil minioUtil; private final MinioUtil minioUtil;


public WorkflowServiceImpl(MinioUtil minioUtil) { public WorkflowServiceImpl(MinioUtil minioUtil) {
@@ -172,7 +172,7 @@ public class WorkflowServiceImpl implements WorkflowService {
Map<String,Object> requestData = new HashMap<>(); Map<String,Object> requestData = new HashMap<>();
requestData.put("data", oldDag); requestData.put("data", oldDag);
// 发送POST请求到Argo工作流复制接口,并将请求数据转换为JSON // 发送POST请求到Argo工作流复制接口,并将请求数据转换为JSON
String req = HttpUtils.sendPost(argoUrl + argoWorkflowCopy , JsonUtils.mapToJson(requestData));
String req = httpUtils.sendPost(argoUrl + argoWorkflowCopy,null , JsonUtils.mapToJson(requestData));
// 检查响应是否为空或无内容 // 检查响应是否为空或无内容
if (StringUtils.isEmpty(req)) { if (StringUtils.isEmpty(req)) {
throw new RuntimeException("工作流复制接口响应内容为空"); throw new RuntimeException("工作流复制接口响应内容为空");


+ 4
- 12
ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml View File

@@ -3,7 +3,7 @@ server:
port: 9201 port: 9201


# Spring # Spring
spring:
spring:
application: application:
# 应用名称 # 应用名称
name: ruoyi-system name: ruoyi-system
@@ -13,21 +13,13 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
namespace: 6caf5d79-c4ce-4e3b-a357-141b74e52a01
# 服务注册地址 # 服务注册地址
server-addr: 172.20.32.181:8848
username: nacos
password: h1n2x3j4y5@
retry:
enabled: true
server-addr: 172.20.32.181:18847
config: config:
namespace: 6caf5d79-c4ce-4e3b-a357-141b74e52a01
# 配置中心地址 # 配置中心地址
server-addr: 172.20.32.181:8848
server-addr: 172.20.32.181:18847
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
shared-configs: shared-configs:
- data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
group: DEFAULT_GROUP
refresh: true
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

Loading…
Cancel
Save