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

This commit is contained in:
chenjianxing 2020-08-05 18:21:15 +08:00
parent 1803f9cf67
commit 60d863208b
1 changed files with 7 additions and 5 deletions

View File

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