fix(接口测试): 解决接口定义导入没有模块的接口的默认值问题

--bug=1011526
--user=郭雨琦
【接口测试】-接口定义中-导入的接口模块默认全部为空了+左侧更多操作中创建接口后默认模块是空,以上两种情况导致左侧树不统计接口数量
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001011526
This commit is contained in:
guoyuqi 2022-03-22 20:04:56 +08:00 committed by xiaomeinvG
parent 9fee04375a
commit 5bea2ee847
1 changed files with 5 additions and 0 deletions

View File

@ -746,6 +746,11 @@ public class ApiDefinitionService {
} else {
apiDefinition.setUserId(apiDefinition.getUserId());
}
if(apiDefinition.getModuleId()==null){
if (StringUtils.isEmpty(apiDefinition.getModuleId()) || "default-module".equals(apiDefinition.getModuleId())) {
initModulePathAndId(apiDefinition.getProjectId(), apiDefinition);
}
}
apiDefinition.setDescription(apiDefinition.getDescription());
List<ApiDefinition> sameRequest;