fix(接口定义): 从回收站恢复接口用例增加重名校验
This commit is contained in:
parent
26c9700da8
commit
88debbc7e5
|
@ -384,7 +384,7 @@ public class ApiTestCaseService {
|
|||
|
||||
public void checkNameExist(SaveApiTestCaseRequest request) {
|
||||
if (hasSameCase(request)) {
|
||||
MSException.throwException(Translator.get("load_test_already_exists"));
|
||||
MSException.throwException(Translator.get("load_test_already_exists") + ": " + request.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1020,7 +1020,19 @@ public class ApiTestCaseService {
|
|||
if (request.isSelectAll()) {
|
||||
ids = this.getAllApiCaseIdsByFontedSelect(request.getFilters(), request.getModuleIds(), request.getName(), request.getProjectId(), request.getProtocol(), request.getUnSelectIds(), request.getStatus(), null, request.getCombine());
|
||||
}
|
||||
|
||||
ApiTestCaseExample apiTestCaseExample = new ApiTestCaseExample();
|
||||
apiTestCaseExample.createCriteria().andIdIn(ids);
|
||||
List<ApiTestCase> apiCaseList = apiTestCaseMapper.selectByExample(apiTestCaseExample);
|
||||
SaveApiTestCaseRequest saveApiTestCaseRequest = new SaveApiTestCaseRequest();
|
||||
if (CollectionUtils.isNotEmpty(apiCaseList)) {
|
||||
for (ApiTestCase apiTestCaseDTO : apiCaseList) {
|
||||
saveApiTestCaseRequest.setName(apiTestCaseDTO.getName());
|
||||
saveApiTestCaseRequest.setApiDefinitionId(apiTestCaseDTO.getApiDefinitionId());
|
||||
saveApiTestCaseRequest.setId(apiTestCaseDTO.getId());
|
||||
saveApiTestCaseRequest.setVersionId(apiTestCaseDTO.getVersionId());
|
||||
checkNameExist(saveApiTestCaseRequest);
|
||||
}
|
||||
}
|
||||
List<String> cannotReductionAPiName = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
List<ApiTestCaseDTO> cannotReductionApiCaseList = extApiTestCaseMapper.getCannotReductionApiCaseList(ids);
|
||||
|
|
|
@ -92,18 +92,29 @@
|
|||
</template>
|
||||
</ms-table-column>
|
||||
|
||||
<ms-table-column
|
||||
prop="caseStatus"
|
||||
:filters="STATUS_FILTERS"
|
||||
:field="item"
|
||||
:fields-width="fieldsWidth"
|
||||
min-width="120px"
|
||||
:label="$t('commons.status')">
|
||||
<ms-table-column v-if="!trashEnable"
|
||||
prop="caseStatus"
|
||||
:filters="STATUS_FILTERS"
|
||||
:field="item"
|
||||
:fields-width="fieldsWidth"
|
||||
min-width="120px"
|
||||
:label="$t('commons.status')">
|
||||
<template v-slot:default="scope">
|
||||
<plan-status-table-item :value="scope.row.caseStatus"/>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
|
||||
<ms-table-column v-if="trashEnable"
|
||||
prop="caseStatus"
|
||||
:field="item"
|
||||
:fields-width="fieldsWidth"
|
||||
min-width="120px"
|
||||
:label="$t('commons.status')">
|
||||
<template v-slot:default="scope">
|
||||
<plan-status-table-item :value="scope.row.status"/>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
|
||||
<ms-table-column
|
||||
prop="execResult"
|
||||
:filters="statusFilters"
|
||||
|
|
Loading…
Reference in New Issue