fix(接口测试): 修复接口测试在url不可重复的设定下进行批量复制时能复制成功的缺陷
--bug=1009744 --user=宋天阳 【接口定义】-接口定义URL不可重复-批量复制接口到其他模块成功,未提示接口地址重复 https://www.tapd.cn/55049933/s/1094257
This commit is contained in:
parent
7453a992f4
commit
cf9b6a017f
|
@ -46,10 +46,7 @@ import io.metersphere.log.vo.StatusReference;
|
|||
import io.metersphere.log.vo.api.DefinitionReference;
|
||||
import io.metersphere.notice.sender.NoticeModel;
|
||||
import io.metersphere.notice.service.NoticeSendService;
|
||||
import io.metersphere.service.FileService;
|
||||
import io.metersphere.service.QuotaService;
|
||||
import io.metersphere.service.RelationshipEdgeService;
|
||||
import io.metersphere.service.ScheduleService;
|
||||
import io.metersphere.service.*;
|
||||
import io.metersphere.track.request.testcase.ApiCaseRelevanceRequest;
|
||||
import io.metersphere.track.request.testcase.QueryTestPlanRequest;
|
||||
import io.metersphere.track.service.TestPlanService;
|
||||
|
@ -1864,6 +1861,9 @@ public class ApiDefinitionService {
|
|||
}
|
||||
|
||||
public void batchCopy(ApiBatchRequest request) {
|
||||
//检查测试项目是否开启了url可重复
|
||||
ProjectService projectService = CommonBeanFactory.getBean(ProjectService.class);
|
||||
projectService.checkProjectIsRepeatable(request.getProjectId());
|
||||
ServiceUtils.getSelectAllIds(request, request.getCondition(),
|
||||
(query) -> extApiDefinitionMapper.selectIds(query));
|
||||
List<String> ids = request.getIds();
|
||||
|
|
|
@ -860,4 +860,15 @@ public class ProjectService {
|
|||
}
|
||||
performanceReportService.cleanUpReport(time, projectId);
|
||||
}
|
||||
|
||||
public void checkProjectIsRepeatable(String projectId) {
|
||||
Project project = this.getProjectById(projectId);
|
||||
if(project == null){
|
||||
MSException.throwException(Translator.get("cannot_find_project"));
|
||||
}else {
|
||||
if(!project.getRepeatable()){
|
||||
MSException.throwException(Translator.get("project_repeatable_is_false"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -290,6 +290,8 @@ zentao_test_type_error=invalid Zentao request
|
|||
#项目报告
|
||||
enterprise_test_report=Enterprise report
|
||||
count=Count
|
||||
cannot_find_project=Cannot find project
|
||||
project_repeatable_is_false=Url repeatable not open
|
||||
#环境组
|
||||
null_environment_group_name = Environment group name is null
|
||||
environment_group_name = Environment group name
|
||||
|
|
|
@ -289,6 +289,8 @@ zentao_test_type_error=无效的 Zentao 请求
|
|||
#项目报告
|
||||
enterprise_test_report=项目报告
|
||||
count=统计
|
||||
cannot_find_project=未找到测试项目
|
||||
project_repeatable_is_false=项目未配置URL可重复
|
||||
#环境组
|
||||
null_environment_group_name = 环境组名称不存在
|
||||
environment_group_name = 环境组名称
|
||||
|
|
|
@ -289,6 +289,8 @@ zentao_test_type_error=請求方式錯誤
|
|||
#项目报告
|
||||
enterprise_test_report=項目報告
|
||||
count=統計
|
||||
cannot_find_project=未找到測試項目
|
||||
project_repeatable_is_false=項目未配置URL可重複
|
||||
#环境组
|
||||
null_environment_group_name = 環境組名稱不存在
|
||||
environment_group_name = 環境組名稱
|
||||
|
|
Loading…
Reference in New Issue