|
@@ -848,12 +848,12 @@ public class ProjectDomainService {
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
public void selectProjectDetailsById(String projectType, String projectId) {
|
|
public void selectProjectDetailsById(String projectType, String projectId) {
|
|
String tokenUrl = customConfiguration.getTokenUri() + "?grant_type=client_credentials" + "&client_id=" + customConfiguration.getClientId() + "&client_secret=" + customConfiguration.getClientSecret();
|
|
String tokenUrl = customConfiguration.getTokenUri() + "?grant_type=client_credentials" + "&client_id=" + customConfiguration.getClientId() + "&client_secret=" + customConfiguration.getClientSecret();
|
|
- log.debug("获取仿真云平台 token:" + tokenUrl);
|
|
|
|
|
|
+ log.info("获取仿真云平台 token:" + tokenUrl);
|
|
String response = HttpUtil.get(tokenUrl);
|
|
String response = HttpUtil.get(tokenUrl);
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
JsonNode jsonNode = objectMapper.readTree(response);
|
|
JsonNode jsonNode = objectMapper.readTree(response);
|
|
String accessToken = jsonNode.path("access_token").asText();
|
|
String accessToken = jsonNode.path("access_token").asText();
|
|
- log.debug("仿真云平台 token 为:" + accessToken);
|
|
|
|
|
|
+ log.info("仿真云平台 token 为:" + accessToken);
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
headers.put("Authorization", "Bearer " + accessToken);
|
|
headers.put("Authorization", "Bearer " + accessToken);
|
|
Map<String, String> params = new HashMap<>();
|
|
Map<String, String> params = new HashMap<>();
|
|
@@ -877,20 +877,22 @@ public class ProjectDomainService {
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
public void selectProjectReportById(String projectType, String projectId) {
|
|
public void selectProjectReportById(String projectType, String projectId) {
|
|
// String tokenUrl = customConfiguration.getTokenUri() + "?grant_type=client_credentials" + "&client_id=" + customConfiguration.getClientId() + "&client_secret=" + customConfiguration.getClientSecret();
|
|
// String tokenUrl = customConfiguration.getTokenUri() + "?grant_type=client_credentials" + "&client_id=" + customConfiguration.getClientId() + "&client_secret=" + customConfiguration.getClientSecret();
|
|
- String tokenUrl = "http://10.14.85.241/simulation/oauth/client/sign/username?username=sysadmin&password=123456";
|
|
|
|
- log.debug("获取仿真云平台 token:" + tokenUrl);
|
|
|
|
- String response = HttpUtil.get(tokenUrl);
|
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
- JsonNode jsonNode = objectMapper.readTree(response);
|
|
|
|
- String accessToken = jsonNode.path("access_token").asText();
|
|
|
|
- log.debug("仿真云平台 token 为:" + accessToken);
|
|
|
|
|
|
+ String tokenUrl = "http://10.14.85.241/simulation/oauth/client/sign/username_for_scheduler";
|
|
|
|
+ Map<String, String> params1 = new HashMap<>();
|
|
|
|
+ params1.put("username", "sysadmin");
|
|
|
|
+ params1.put("password", "123456");
|
|
|
|
+ String response = HttpUtil.post(tokenUrl, null, params1);
|
|
|
|
+ log.info("获取仿真云平台 token:" + tokenUrl + ",结果为:" + response);
|
|
|
|
+ String accessTokenString = JsonUtil.getString(response, "info.access_token");
|
|
|
|
+ final String accessToken = accessTokenString.substring(1, accessTokenString.length() - 1);
|
|
|
|
+ log.info("仿真云平台 token 为:" + accessToken);
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
headers.put("Authorization", "Bearer " + accessToken);
|
|
headers.put("Authorization", "Bearer " + accessToken);
|
|
- Map<String, String> params = new HashMap<>();
|
|
|
|
- params.put("projectType", projectType);
|
|
|
|
- params.put("id", projectId);
|
|
|
|
- String result = HttpUtil.post(customConfiguration.getProjectReportUri(), headers, params);
|
|
|
|
- log.info("访问仿真云平台项目报告接口:" + customConfiguration.getProjectReportUri() + ",请求头为:" + headers + ",请求体为:" + params + "结果为:" + result);
|
|
|
|
|
|
+ Map<String, String> params2 = new HashMap<>();
|
|
|
|
+ params2.put("projectType", projectType);
|
|
|
|
+ params2.put("id", projectId);
|
|
|
|
+ String result = HttpUtil.post(customConfiguration.getProjectReportUri(), headers, params2);
|
|
|
|
+ log.info("访问仿真云平台项目报告接口:" + customConfiguration.getProjectReportUri() + ",请求头为:" + headers + ",请求体为:" + params2 + "结果为:" + result);
|
|
ResponseBodyVO<?> responseBodyVO = JsonUtil.jsonToBean(result, ResponseBodyVO.class);
|
|
ResponseBodyVO<?> responseBodyVO = JsonUtil.jsonToBean(result, ResponseBodyVO.class);
|
|
String projectReportVOJson = JsonUtil.beanToJson(responseBodyVO.getInfo());
|
|
String projectReportVOJson = JsonUtil.beanToJson(responseBodyVO.getInfo());
|
|
TimeUnit.SECONDS.sleep(3);
|
|
TimeUnit.SECONDS.sleep(3);
|
|
@@ -995,7 +997,7 @@ public class ProjectDomainService {
|
|
} else {
|
|
} else {
|
|
throw new RuntimeException("未知项目类型:" + projectType);
|
|
throw new RuntimeException("未知项目类型:" + projectType);
|
|
}
|
|
}
|
|
- if ( DictConstants.ALGORITHM_UPLOAD_MODE_PLATFORM.equals(algorithmType)) {
|
|
|
|
|
|
+ if (DictConstants.ALGORITHM_UPLOAD_MODE_PLATFORM.equals(algorithmType)) {
|
|
return algorithmExpandMapper.selectDockerImageByAlgorithmId(algorithmId);
|
|
return algorithmExpandMapper.selectDockerImageByAlgorithmId(algorithmId);
|
|
} else {
|
|
} else {
|
|
return algorithmMapper.selectDockerImageById(algorithmId);
|
|
return algorithmMapper.selectDockerImageById(algorithmId);
|