fix: 接口测试首页定时任务

This commit is contained in:
chenjianxing 2020-08-05 18:21:15 +08:00
parent 1803f9cf67
commit 60d863208b

View File

@ -318,11 +318,13 @@ public class APITestService {
List<String> resourceIds = schedules.stream()
.map(Schedule::getResourceId)
.collect(Collectors.toList());
ApiTestExample example = new ApiTestExample();
example.createCriteria().andIdIn(resourceIds);
List<ApiTest> apiTests = apiTestMapper.selectByExample(example);
Map<String, String> apiTestMap = apiTests.stream().collect(Collectors.toMap(ApiTest::getId, ApiTest::getName));
scheduleService.build(apiTestMap, schedules);
if (!resourceIds.isEmpty()) {
ApiTestExample example = new ApiTestExample();
example.createCriteria().andIdIn(resourceIds);
List<ApiTest> apiTests = apiTestMapper.selectByExample(example);
Map<String, String> apiTestMap = apiTests.stream().collect(Collectors.toMap(ApiTest::getId, ApiTest::getName));
scheduleService.build(apiTestMap, schedules);
}
return schedules;
}
}