From 60356f872cc2bbba232734c06a99de316f16f0a0 Mon Sep 17 00:00:00 2001 From: coryhh <44330697+coryhh@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:51:38 +0800 Subject: [PATCH] feat: add labels, when pinning case from replay (#340) --- .../web/api/service/controller/FileSystemController.java | 1 + .../web/core/business/filesystem/FileSystemService.java | 4 ++++ .../contracts/filesystem/FSAddItemFromRecordRequestType.java | 3 +++ .../filesystem/FsAddItemFromRecordByDefaultRequestType.java | 3 +++ 4 files changed, 11 insertions(+) diff --git a/arex-web-api/src/main/java/com/arextest/web/api/service/controller/FileSystemController.java b/arex-web-api/src/main/java/com/arextest/web/api/service/controller/FileSystemController.java index 4f2458ab..4540e5e5 100644 --- a/arex-web-api/src/main/java/com/arextest/web/api/service/controller/FileSystemController.java +++ b/arex-web-api/src/main/java/com/arextest/web/api/service/controller/FileSystemController.java @@ -335,6 +335,7 @@ public Response validInvitation(@Valid @RequestBody ValidInvitationRequestType r return ResponseUtils.successResponse(responseType); } + @Deprecated @PostMapping("/addItemFromRecord") @ResponseBody public Response addItemFromRecord(@Valid @RequestBody FSAddItemFromRecordRequestType request) { diff --git a/arex-web-core/src/main/java/com/arextest/web/core/business/filesystem/FileSystemService.java b/arex-web-core/src/main/java/com/arextest/web/core/business/filesystem/FileSystemService.java index 1f3b9775..424f86d5 100644 --- a/arex-web-core/src/main/java/com/arextest/web/core/business/filesystem/FileSystemService.java +++ b/arex-web-core/src/main/java/com/arextest/web/core/business/filesystem/FileSystemService.java @@ -747,6 +747,7 @@ public MutablePair addItemFromRecordByDefault( fsAddItemFromRecordRequest.setPlanId(request.getPlanId()); fsAddItemFromRecordRequest.setRecordId(request.getRecordId()); fsAddItemFromRecordRequest.setOperationId(request.getOperationId()); + fsAddItemFromRecordRequest.setLabelIds(request.getLabelIds()); FSTreeDto treeDto = fsTreeRepository.queryFSTreeById(request.getWorkspaceId()); if (treeDto == null) { @@ -847,6 +848,9 @@ public MutablePair addItemFromRecord(FSAddItemFromRecordRequestT String newRecordId = storageCase.getNewRecordId(request.getRecordId()); caseDto.setRecordId(newRecordId); + // set labels + caseDto.setLabelIds(request.getLabelIds()); + KeyValuePairDto recordHeader = new KeyValuePairDto(); recordHeader.setKey(AREX_RECORD_ID); recordHeader.setValue(newRecordId); diff --git a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FSAddItemFromRecordRequestType.java b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FSAddItemFromRecordRequestType.java index a682659f..9977d812 100644 --- a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FSAddItemFromRecordRequestType.java +++ b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FSAddItemFromRecordRequestType.java @@ -1,5 +1,6 @@ package com.arextest.web.model.contract.contracts.filesystem; +import java.util.Set; import javax.validation.constraints.NotBlank; import lombok.Data; @@ -16,4 +17,6 @@ public class FSAddItemFromRecordRequestType { private String recordId; @NotBlank(message = "operationId cannot be empty") private String operationId; + + private Set labelIds; } diff --git a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FsAddItemFromRecordByDefaultRequestType.java b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FsAddItemFromRecordByDefaultRequestType.java index 59dc73a2..e780f4fa 100644 --- a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FsAddItemFromRecordByDefaultRequestType.java +++ b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/filesystem/FsAddItemFromRecordByDefaultRequestType.java @@ -1,5 +1,6 @@ package com.arextest.web.model.contract.contracts.filesystem; +import java.util.Set; import javax.validation.constraints.NotBlank; import lombok.Data; @@ -21,4 +22,6 @@ public class FsAddItemFromRecordByDefaultRequestType { private String recordId; @NotBlank(message = "operationId cannot be empty") private String operationId; + + private Set labelIds; }