refactor(系统设置): 更新k8s任务相关信息
This commit is contained in:
parent
b6f58a89dd
commit
597989781b
|
@ -7,59 +7,63 @@ import lombok.Setter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*用来解析TestResourceBlob的结构
|
* 用来解析TestResourceBlob的结构
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class TestResourceDTO {
|
public class TestResourceDTO {
|
||||||
|
/**
|
||||||
|
* 资源id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type为 node时, 接口测试 性能测试 node 节点配置
|
* type为 node时, 接口测试 node 节点配置
|
||||||
*/
|
*/
|
||||||
@Schema(description = "type为node时, 接口测试,性能测试node节点配置")
|
@Schema(description = "type为node时, 接口测试")
|
||||||
private List<TestResourceNodeDTO> nodesList;
|
private List<TestResourceNodeDTO> nodesList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type为 k8s 时,接口测试,性能测试的ip
|
* type为 k8s 时,接口测试
|
||||||
*/
|
*/
|
||||||
@Schema(description = "type为k8s时,接口测试,性能测试的ip")
|
@Schema(description = "type为k8s时,接口测试")
|
||||||
private String ip;
|
private String ip;
|
||||||
/**
|
/**
|
||||||
* type为 k8s 时,接口测试,性能测试的token
|
* type为 k8s 时,接口测试
|
||||||
*/
|
*/
|
||||||
@Schema(description = "type为k8s时,接口测试,性能测试的token")
|
@Schema(description = "type为k8s时,接口测试")
|
||||||
private String token;
|
private String token;
|
||||||
/**
|
/**
|
||||||
* type为 k8s 时,接口测试,性能测试的命名空间
|
* type为 k8s 时,接口测试命名空间
|
||||||
*/
|
*/
|
||||||
@Schema(description = "type为k8s时,接口测试,性能测试的命名空间")
|
@Schema(description = "type为k8s时,接口测试")
|
||||||
private String namespace;
|
private String namespace;
|
||||||
/**
|
/**
|
||||||
* type为 k8s 时,接口测试,性能测试,UI测试的最大并发数
|
* type为 k8s 时,接口测试
|
||||||
*/
|
*/
|
||||||
@Schema(description = "type为k8s时,接口测试,性能测试,UI测试的最大并发数")
|
@Schema(description = "type为k8s时,接口测试")
|
||||||
private Integer concurrentNumber;
|
private Integer concurrentNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type为 k8s 时,接口测试,性能测试的单pod 最大线程数
|
* type为k8s时,最大任务并发数
|
||||||
*/
|
*/
|
||||||
@Schema(description = "type为k8s时,接口测试,性能测试的单pod最大线程数")
|
@Schema(description = "type为k8s时,最大任务并发数")
|
||||||
private Integer podThreads;
|
private Integer podThreads;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type为 k8s 时,接口测试deployName
|
* type为 k8s 时,接口测试deployName
|
||||||
*/
|
*/
|
||||||
@Schema(description = "type为k8s时,接口测试deployName")
|
@Schema(description = "type为k8s时,接口测试deployName")
|
||||||
private String deployName;
|
private String deployName;
|
||||||
|
|
||||||
@Schema(description = "grid最大线程数")
|
@Schema(description = "grid最大线程数")
|
||||||
private Integer girdConcurrentNumber;
|
private Integer girdConcurrentNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联的组织id集合
|
* 关联的组织id集合
|
||||||
*/
|
*/
|
||||||
@Schema(description = "关联的组织id集合")
|
@Schema(description = "关联的组织id集合")
|
||||||
private List<String>orgIds;
|
private List<String> orgIds;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,28 +171,26 @@ public class BaseTaskHubService {
|
||||||
UserExample userExample = new UserExample();
|
UserExample userExample = new UserExample();
|
||||||
userExample.createCriteria().andIdIn(userIds);
|
userExample.createCriteria().andIdIn(userIds);
|
||||||
List<User> userList = userMapper.selectByExample(userExample);
|
List<User> userList = userMapper.selectByExample(userExample);
|
||||||
Map<String, String> userMaps = userList.stream().collect(Collectors.toMap(User::getId, User::getName));
|
return userList.stream().collect(Collectors.toMap(User::getId, User::getName));
|
||||||
return userMaps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, String> getOrganizationMaps(List<String> organizationIds) {
|
private Map<String, String> getOrganizationMaps(List<String> organizationIds) {
|
||||||
OrganizationExample organizationExample = new OrganizationExample();
|
OrganizationExample organizationExample = new OrganizationExample();
|
||||||
organizationExample.createCriteria().andIdIn(organizationIds);
|
organizationExample.createCriteria().andIdIn(organizationIds);
|
||||||
List<Organization> organizationList = organizationMapper.selectByExample(organizationExample);
|
List<Organization> organizationList = organizationMapper.selectByExample(organizationExample);
|
||||||
Map<String, String> organizationMaps = organizationList.stream().collect(Collectors.toMap(Organization::getId, Organization::getName));
|
return organizationList.stream().collect(Collectors.toMap(Organization::getId, Organization::getName));
|
||||||
return organizationMaps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, String> getProjectMaps(List<String> projectIds) {
|
private Map<String, String> getProjectMaps(List<String> projectIds) {
|
||||||
ProjectExample projectExample = new ProjectExample();
|
ProjectExample projectExample = new ProjectExample();
|
||||||
projectExample.createCriteria().andIdIn(projectIds);
|
projectExample.createCriteria().andIdIn(projectIds);
|
||||||
List<Project> projectList = projectMapper.selectByExample(projectExample);
|
List<Project> projectList = projectMapper.selectByExample(projectExample);
|
||||||
Map<String, String> projectMaps = projectList.stream().collect(Collectors.toMap(Project::getId, Project::getName));
|
return projectList.stream().collect(Collectors.toMap(Project::getId, Project::getName));
|
||||||
return projectMaps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取任务的报告集合
|
* 获取任务的报告集合
|
||||||
|
*
|
||||||
* @param taskIds 任务ID集合
|
* @param taskIds 任务ID集合
|
||||||
* @return 报告集合
|
* @return 报告集合
|
||||||
*/
|
*/
|
||||||
|
@ -238,8 +236,8 @@ public class BaseTaskHubService {
|
||||||
Map<String, String> userMap = userLoginService.getUserNameMap(new ArrayList<>(userSet));
|
Map<String, String> userMap = userLoginService.getUserNameMap(new ArrayList<>(userSet));
|
||||||
|
|
||||||
List<String> resourceIds = list.stream()
|
List<String> resourceIds = list.stream()
|
||||||
.filter(item -> StringUtils.isNotBlank(item.getResourceId()))
|
|
||||||
.map(TaskHubScheduleDTO::getResourceId)
|
.map(TaskHubScheduleDTO::getResourceId)
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
Map<String, TaskHubScheduleDTO> trigerTimeMap = Map.of();
|
Map<String, TaskHubScheduleDTO> trigerTimeMap = Map.of();
|
||||||
|
@ -378,8 +376,7 @@ public class BaseTaskHubService {
|
||||||
TestResourcePoolExample poolExample = new TestResourcePoolExample();
|
TestResourcePoolExample poolExample = new TestResourcePoolExample();
|
||||||
poolExample.createCriteria().andIdIn(resourcePoolIds);
|
poolExample.createCriteria().andIdIn(resourcePoolIds);
|
||||||
List<TestResourcePool> poolList = testResourcePoolMapper.selectByExample(poolExample);
|
List<TestResourcePool> poolList = testResourcePoolMapper.selectByExample(poolExample);
|
||||||
Map<String, String> poolMaps = poolList.stream().collect(Collectors.toMap(TestResourcePool::getId, TestResourcePool::getName));
|
return poolList.stream().collect(Collectors.toMap(TestResourcePool::getId, TestResourcePool::getName));
|
||||||
return poolMaps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -439,8 +436,7 @@ public class BaseTaskHubService {
|
||||||
TestResourcePoolBlobExample blobExample = new TestResourcePoolBlobExample();
|
TestResourcePoolBlobExample blobExample = new TestResourcePoolBlobExample();
|
||||||
blobExample.createCriteria().andIdIn(ids);
|
blobExample.createCriteria().andIdIn(ids);
|
||||||
List<TestResourcePoolBlob> testResourcePoolBlobs = testResourcePoolBlobMapper.selectByExampleWithBLOBs(blobExample);
|
List<TestResourcePoolBlob> testResourcePoolBlobs = testResourcePoolBlobMapper.selectByExampleWithBLOBs(blobExample);
|
||||||
Map<String, List<TestResourcePoolBlob>> poolMap = testResourcePoolBlobs.stream().collect(Collectors.groupingBy(TestResourcePoolBlob::getId));
|
return testResourcePoolBlobs.stream().collect(Collectors.groupingBy(TestResourcePoolBlob::getId));
|
||||||
return poolMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ResourcePoolOptionsDTO> handleOptions(List<TestResourcePool> allResourcePools, Map<String, List<TestResourcePoolBlob>> poolMap) {
|
private List<ResourcePoolOptionsDTO> handleOptions(List<TestResourcePool> allResourcePools, Map<String, List<TestResourcePoolBlob>> poolMap) {
|
||||||
|
@ -525,7 +521,7 @@ public class BaseTaskHubService {
|
||||||
node.setPort(split[1]);
|
node.setPort(split[1]);
|
||||||
status = nodeResourcePoolService.validateNode(node);
|
status = nodeResourcePoolService.validateNode(node);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
status = false;
|
LogUtils.error(e);
|
||||||
}
|
}
|
||||||
boolean finalStatus = status;
|
boolean finalStatus = status;
|
||||||
v.forEach(item -> {
|
v.forEach(item -> {
|
||||||
|
@ -888,6 +884,7 @@ public class BaseTaskHubService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询批量执行任务报告列表
|
* 查询批量执行任务报告列表
|
||||||
|
*
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
* @return 执行任务报告集合
|
* @return 执行任务报告集合
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue