diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiCaseBatchEditRequest.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiCaseBatchEditRequest.java index a0ea4dd565..6078f0cbaf 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiCaseBatchEditRequest.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiCaseBatchEditRequest.java @@ -29,7 +29,7 @@ public class ApiCaseBatchEditRequest extends ApiTestCaseBatchRequest implements private boolean appendTag = false; @Schema(description = "环境id") @Size(max = 50, message = "{api_test_case.env_id.length_range}") - private String envId; + private String environmentId; @Schema(description = "用例状态") @Size(max = 20, message = "{api_test_case.status.length_range}") private String status; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/debug/ApiDebugService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/debug/ApiDebugService.java index 9e44f70203..d6f2a14d9d 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/debug/ApiDebugService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/debug/ApiDebugService.java @@ -238,7 +238,7 @@ public class ApiDebugService extends MoveNodeService { } public void editPos(ApiEditPosRequest request, String userId) { - ApiDebug apiDebug = checkResourceExist(request.getTargetId()); + ApiDebug apiDebug = checkResourceExist(request.getMoveId()); if (!StringUtils.equals(request.getModuleId(), apiDebug.getModuleId())) { checkModuleExist(request.getModuleId()); apiDebug.setModuleId(request.getModuleId()); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java index d976db819b..406a86b1d5 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java @@ -1057,7 +1057,7 @@ public class ApiDefinitionService extends MoveNodeService { } public void editPos(ApiEditPosRequest request, String userId) { - ApiDefinition apiDefinition = checkApiDefinition(request.getTargetId()); + ApiDefinition apiDefinition = checkApiDefinition(request.getMoveId()); if (!StringUtils.equals(request.getModuleId(), apiDefinition.getModuleId())) { checkModuleExist(request.getModuleId()); apiDefinition.setUpdateTime(System.currentTimeMillis()); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java index 342bca27da..b544278834 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java @@ -454,7 +454,7 @@ public class ApiTestCaseService extends MoveNodeService { case PRIORITY -> batchUpdatePriority(example, updateCase, request.getPriority(), mapper); case STATUS -> batchUpdateStatus(example, updateCase, request.getStatus(), mapper); case TAGS -> batchUpdateTags(example, updateCase, request, ids, mapper); - case ENVIRONMENT -> batchUpdateEnvironment(example, updateCase, request.getEnvId(), mapper); + case ENVIRONMENT -> batchUpdateEnvironment(example, updateCase, request.getEnvironmentId(), mapper); default -> throw new MSException(Translator.get("batch_edit_type_error")); } sqlSession.flushStatements(); diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugControllerTests.java index c3adb07de0..04c4d20c95 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDebugControllerTests.java @@ -419,7 +419,7 @@ public class ApiDebugControllerTests extends BaseTest { request.setMoveMode("AFTER"); requestPost("edit/pos", request).andExpect(status().isOk()); // @@请求成功 - request.setMoveId(anotherAddApiDebug.getId()); + request.setTargetId(anotherAddApiDebug.getId()); this.requestPostWithOk("edit/pos", request); // 校验请求成功数据 ApiDebug apiDebug = apiDebugMapper.selectByPrimaryKey(addApiDebug.getId()); diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTestCaseControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTestCaseControllerTests.java index 4439add41c..8a816d33c5 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTestCaseControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTestCaseControllerTests.java @@ -882,16 +882,16 @@ public class ApiTestCaseControllerTests extends BaseTest { EnvironmentExample environmentExample = new EnvironmentExample(); environmentExample.createCriteria().andProjectIdEqualTo(DEFAULT_PROJECT_ID).andMockEqualTo(true); List environments = environmentMapper.selectByExample(environmentExample); - request.setEnvId(environments.get(0).getId()); + request.setEnvironmentId(environments.get(0).getId()); requestPostWithOkAndReturn(BATCH_EDIT, request); //判断数据的环境是不是environments.get(0).getId() caseList = apiTestCaseMapper.selectByExample(example); caseList.forEach(apiTestCase -> Assertions.assertEquals(apiTestCase.getEnvironmentId(), environments.get(0).getId())); //环境数据为空 - request.setEnvId(null); + request.setEnvironmentId(null); this.requestPost(BATCH_EDIT, request, ERROR_REQUEST_MATCHER); //环境不存在 - request.setEnvId("111"); + request.setEnvironmentId("111"); this.requestPost(BATCH_EDIT, request, ERROR_REQUEST_MATCHER); //类型错误 request.setType("111"); diff --git a/frontend/src/views/api-test/debug/components/moduleTree.vue b/frontend/src/views/api-test/debug/components/moduleTree.vue index 36eef3b95a..a8b20084d7 100644 --- a/frontend/src/views/api-test/debug/components/moduleTree.vue +++ b/frontend/src/views/api-test/debug/components/moduleTree.vue @@ -416,7 +416,7 @@ projectId: appStore.currentProjectId, moveMode: dropPositionMap[dropPosition], moveId: dragNode.id, - targetId: dropNode.id, + targetId: dropNode.type === 'MODULE' ? dragNode.id : dropNode.id, moduleId: dropNode.type === 'API' ? dropNode.parentId : dropNode.id, // 释放节点是 API,则传入它所属模块id;模块的话直接是模块id }); } diff --git a/frontend/src/views/api-test/management/components/moduleTree.vue b/frontend/src/views/api-test/management/components/moduleTree.vue index ed47c70977..2da89f5330 100644 --- a/frontend/src/views/api-test/management/components/moduleTree.vue +++ b/frontend/src/views/api-test/management/components/moduleTree.vue @@ -555,7 +555,7 @@ projectId: appStore.currentProjectId, moveMode: dropPositionMap[dropPosition], moveId: dragNode.id, - targetId: dropNode.id, + targetId: dropNode.type === 'MODULE' ? dragNode.id : dropNode.id, moduleId: dropNode.type === 'API' ? dropNode.parentId : dropNode.id, // 释放节点是 API,则传入它所属模块id;模块的话直接是模块id }); }