From 638e4ec6df1fbcf4dded411062d153fe8d4bb5a3 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 29 Aug 2024 10:53:58 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=BC=BA=E9=99=B7=E6=96=B0=E5=A2=9E=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/bug/dto/request/BugEditRequest.java | 7 +++++-- .../main/java/io/metersphere/bug/service/BugService.java | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java index 98032acdd3..6f6ac562b3 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java @@ -55,13 +55,16 @@ public class BugEditRequest implements Serializable { @Schema(description = "关联附件集合, 文件ID") private List linkFileIds; - @Schema(description = "用例ID") + @Schema(description = "用例ID, 创建缺陷并关联时必填") private String caseId; + @Schema(description = "用例类型, 创建缺陷并关联时必填", allowableValues = {"FUNCTIONAL", "API", "SCENARIO"}) + private String caseType; + @Schema(description = "测试计划ID,通过测试计划创建的必填") private String testPlanId; - @Schema(description = "测试计划关联的用例ID, 通过测试计划创建的必填,值是关联的id而不是用例id") + @Schema(description = "测试计划关联的用例ID, 通过测试计划创建的必填,值是关联的关系ID而不是用例ID") private String testPlanCaseId; @Schema(description = "复制的附件") diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java index ebb7e5477c..af66c70f8b 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java @@ -1381,7 +1381,7 @@ public class BugService { } /** - * 处理并保存缺陷用例关联关系 + * 处理并保存缺陷用例关联关系 (单条用例, 多条关联新增缺陷跳过) * * @param request 请求参数 * @param isUpdate 是否更新 @@ -1395,7 +1395,7 @@ public class BugService { bugRelationCase.setId(IDGenerator.nextStr()); bugRelationCase.setCaseId(request.getCaseId()); bugRelationCase.setBugId(bug.getId()); - bugRelationCase.setCaseType(CaseType.FUNCTIONAL_CASE.getKey()); + bugRelationCase.setCaseType(request.getCaseType()); bugRelationCase.setCreateUser(currentUser); bugRelationCase.setCreateTime(System.currentTimeMillis()); bugRelationCase.setUpdateTime(System.currentTimeMillis());