fix(接口测试): 修复批量复制接口没有复制自定义字段的缺陷

--bug=1026631 --user=王孝刚 【接口测试】api列表-批量复制多个api到其它模块下-查看复制的api-自定义字段未显示数据
https://www.tapd.cn/55049933/s/1377820
This commit is contained in:
wxg0103 2023-06-01 12:07:21 +08:00 committed by fit2-zhao
parent 3f30861966
commit 07b9584d71
1 changed files with 4 additions and 0 deletions

View File

@ -1908,6 +1908,10 @@ public class ApiDefinitionService {
// 检查附件复制出附件
ApiFileUtil.copyBodyFiles(sourceId, api.getId());
List<CustomFieldResourceDTO> byResourceId = customFieldApiService.getByResourceId(sourceId);
if (CollectionUtils.isNotEmpty(byResourceId)){
customFieldApiService.addFields(api.getId(), byResourceId);
}
mapper.insert(api);
if (i % 50 == 0) sqlSession.flushStatements();
}