fix(接口测试): 修复批量删除api接口报sql异常的缺陷

--bug=1024917 --user=王孝刚 【接口测试】api-回收站- 全选批量删除报sql异常
https://www.tapd.cn/55049933/s/1356281
This commit is contained in:
wxg0103 2023-03-27 19:58:25 +08:00 committed by fit2-zhao
parent 85f4431132
commit 38a81803e9
1 changed files with 8 additions and 6 deletions

View File

@ -682,14 +682,16 @@ public class MockConfigService {
MockConfigExample configExample = new MockConfigExample();
configExample.createCriteria().andApiIdIn(apiIds);
List<MockConfig> mockConfigList = mockConfigMapper.selectByExample(configExample);
MockExpectConfigExample example = new MockExpectConfigExample();
List<String> mockConfigIds = mockConfigList.stream().map(MockConfig::getId).toList();
if (CollectionUtils.isNotEmpty(mockConfigIds)) {
MockExpectConfigExample example = new MockExpectConfigExample();
example.createCriteria().andMockConfigIdIn(mockConfigIds);
List<MockExpectConfigWithBLOBs> deleteBlobs = mockExpectConfigMapper.selectByExampleWithBLOBs(example);
for (MockExpectConfigWithBLOBs model : deleteBlobs) {
this.deleteMockExpectFiles(model);
}
mockExpectConfigMapper.deleteByExample(example);
}
mockConfigMapper.deleteByExample(configExample);
}