diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseMinderController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseMinderController.java index 6c5511f96c..d1a289d492 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseMinderController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseMinderController.java @@ -4,10 +4,7 @@ import com.alibaba.excel.util.StringUtils; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.functional.dto.FunctionalMinderTreeDTO; -import io.metersphere.functional.request.FunctionalCaseMindRequest; -import io.metersphere.functional.request.FunctionalCaseMinderEditRequest; -import io.metersphere.functional.request.FunctionalCasePlanMindRequest; -import io.metersphere.functional.request.FunctionalCaseReviewMindRequest; +import io.metersphere.functional.request.*; import io.metersphere.functional.service.FunctionalCaseMinderService; import io.metersphere.sdk.constants.PermissionConstants; import io.metersphere.system.dto.sdk.BaseTreeNode; @@ -42,7 +39,7 @@ public class FunctionalCaseMinderController { @Operation(summary = "用例管理-功能用例-脑图-获取空白节点和模块的组合树") @RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ) @CheckOwner(resourceId = "#projectId", resourceType = "project") - public List getTree(@Validated @RequestBody FunctionalCaseMindRequest request) { + public List getTree(@Validated @RequestBody FunctionalCaseMindTreeRequest request) { return functionalCaseMinderService.getTree(request); } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCaseMindTreeRequest.java b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCaseMindTreeRequest.java new file mode 100644 index 0000000000..249a95a6df --- /dev/null +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCaseMindTreeRequest.java @@ -0,0 +1,16 @@ +package io.metersphere.functional.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +@Data +public class FunctionalCaseMindTreeRequest { + @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{functional_case.project_id.not_blank}") + private String projectId; + + @Schema(description = "模块ID", requiredMode = Schema.RequiredMode.REQUIRED) + private String moduleId; + +} diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java index b8dc6d8d7f..e52efe8260 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java @@ -1162,7 +1162,7 @@ public class FunctionalCaseMinderService { } - public List getTree(FunctionalCaseMindRequest request) { + public List getTree(FunctionalCaseMindTreeRequest request) { List functionalModuleList = extFunctionalCaseModuleMapper.selectBaseByProjectId(request.getProjectId()); List baseTreeNodes = extFunctionalCaseMapper.selectBaseMindNodeByProjectId(request.getProjectId()); functionalModuleList.addAll(baseTreeNodes); diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java index 6b4069199f..cb4dd8add0 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java @@ -334,9 +334,8 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { @Test @Order(3) public void testGetCaseModuleNodeList() throws Exception { - FunctionalCaseMindRequest request = new FunctionalCaseMindRequest(); + FunctionalCaseMindTreeRequest request = new FunctionalCaseMindTreeRequest(); request.setProjectId("project-case-minder-test"); - request.setCurrent(1); MvcResult mvcResultPage = this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_NODE_MODULE_URL, request); String contentAsString = mvcResultPage.getResponse().getContentAsString(StandardCharsets.UTF_8); ResultHolder resultHolder = JSON.parseObject(contentAsString, ResultHolder.class);