fix: 回收站批量删除接口定义没有删除用例
This commit is contained in:
parent
9d347826ce
commit
2918fc8a61
|
@ -220,6 +220,7 @@ public class ApiDefinitionService {
|
|||
example.createCriteria().andIdIn(apiIds);
|
||||
esbApiParamService.deleteByResourceIdIn(apiIds);
|
||||
apiDefinitionMapper.deleteByExample(example);
|
||||
apiTestCaseService.deleteBatchByDefinitionId(apiIds);
|
||||
}
|
||||
|
||||
public void removeToGc(List<String> apiIds) {
|
||||
|
@ -1051,6 +1052,7 @@ public class ApiDefinitionService {
|
|||
|
||||
public void deleteByParams(ApiBatchRequest request) {
|
||||
apiDefinitionMapper.deleteByExample(getBatchExample(request));
|
||||
apiTestCaseService.deleteBatchByDefinitionId(request.getIds());
|
||||
}
|
||||
|
||||
public ApiDefinitionExample getBatchExample(ApiBatchRequest request) {
|
||||
|
|
|
@ -433,6 +433,17 @@ public class ApiTestCaseService {
|
|||
apiTestCaseMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
public void deleteBatchByDefinitionId(List<String> definitionIds) {
|
||||
ApiTestCaseExample example = new ApiTestCaseExample();
|
||||
example.createCriteria().andApiDefinitionIdIn(definitionIds);
|
||||
apiTestCaseMapper.deleteByExample(example);
|
||||
List<ApiTestCase> apiTestCases = apiTestCaseMapper.selectByExample(example);
|
||||
List<String> caseIds = apiTestCases.stream().map(ApiTestCase::getId).collect(Collectors.toList());
|
||||
for (String testId : caseIds) {
|
||||
extTestPlanTestCaseMapper.deleteByTestCaseID(testId);
|
||||
}
|
||||
}
|
||||
|
||||
public void relevanceByApi(ApiCaseRelevanceRequest request) {
|
||||
if (CollectionUtils.isEmpty(request.getSelectIds())) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue