From 9bf626cf0e73fdba5f24a1b531e4cab7cfbb7e86 Mon Sep 17 00:00:00 2001 From: bjkim Date: Tue, 23 Sep 2025 20:19:41 +0900 Subject: [PATCH] =?UTF-8?q?[UPDATE]=20MinioAttachmentService=20=EB=B0=8F?= =?UTF-8?q?=20MinioAttachmentController=EC=97=90=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20ID=20=EC=B2=98=EB=A6=AC=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=97=94=ED=8B=B0?= =?UTF-8?q?=ED=8B=B0=20=ED=95=84=EB=93=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../etri/autoflow/controllers/MinioAttachmentController.java | 4 +++- .../kr/re/etri/autoflow/service/MinioAttachmentService.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/kr/re/etri/autoflow/controllers/MinioAttachmentController.java b/src/main/java/kr/re/etri/autoflow/controllers/MinioAttachmentController.java index 96f3956..e18d0e8 100644 --- a/src/main/java/kr/re/etri/autoflow/controllers/MinioAttachmentController.java +++ b/src/main/java/kr/re/etri/autoflow/controllers/MinioAttachmentController.java @@ -196,6 +196,8 @@ public class MinioAttachmentController { public ResponseEntity> updateFile( @Parameter(description = "기존 첨부파일 ID", required = true) @PathVariable("id") Long id, + @Parameter(description = "프로젝트 ID", required = true) + @RequestParam("projectId") Long projectId, @Parameter(description = "새 파일") @RequestPart("file") MultipartFile file, @RequestPart(value = "path", required = false) String path, @RequestParam(value = "title", required = false) String title, @@ -204,7 +206,7 @@ public class MinioAttachmentController { ) { try { MinioAttachmentEntity updated = minioAttachmentService.updateFile( - id, file, path, title, description, regUserId + id, projectId, file, path, title, description, regUserId ); Map response = new HashMap<>(); diff --git a/src/main/java/kr/re/etri/autoflow/service/MinioAttachmentService.java b/src/main/java/kr/re/etri/autoflow/service/MinioAttachmentService.java index c351b09..cb6ce1c 100644 --- a/src/main/java/kr/re/etri/autoflow/service/MinioAttachmentService.java +++ b/src/main/java/kr/re/etri/autoflow/service/MinioAttachmentService.java @@ -153,6 +153,7 @@ public class MinioAttachmentService { public MinioAttachmentEntity updateFile( Long id, + Long projectId, // 추가 MultipartFile file, String path, String title, @@ -190,6 +191,7 @@ public class MinioAttachmentService { // 새로운 엔티티 생성 (이전 데이터는 그대로 두고, 새로운 버전 생성) MinioAttachmentEntity newAttachment = MinioAttachmentEntity.builder() + .projectId(projectId) // 추가 .refId(existing.getRefId()) .refType(existing.getRefType()) .originalName(file.getOriginalFilename()) @@ -206,7 +208,6 @@ public class MinioAttachmentService { return minioAttachmentRepository.save(newAttachment); } - /** * 생성 (DB만 저장, 파일은 따로 업로드된 경우) */