From 12969a02f2b75bde3d29a5d6a710443230885708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=9A=A9=EC=88=98?= Date: Thu, 26 Sep 2024 01:30:48 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Feat:=20=EB=A0=88=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=EC=8B=9C=20=EC=83=81=ED=83=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/worlabel/domain/image/service/ImageService.java | 3 +++ .../com/worlabel/domain/project/service/ProjectService.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java b/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java index 098a430..f4e8ea2 100644 --- a/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java +++ b/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java @@ -3,6 +3,7 @@ package com.worlabel.domain.image.service; import com.worlabel.domain.folder.entity.Folder; import com.worlabel.domain.folder.repository.FolderRepository; import com.worlabel.domain.image.entity.Image; +import com.worlabel.domain.image.entity.LabelStatus; import com.worlabel.domain.image.entity.dto.*; import com.worlabel.domain.image.repository.ImageRepository; import com.worlabel.domain.participant.entity.PrivilegeType; @@ -254,6 +255,8 @@ public class ImageService { String dataPath = image.getDataPath(); s3UploadService.uploadJson(data, dataPath); + image.updateStatus(LabelStatus.IN_PROGRESS); + imageRepository.save(image); } private String getExtension(final MultipartFile file) { diff --git a/backend/src/main/java/com/worlabel/domain/project/service/ProjectService.java b/backend/src/main/java/com/worlabel/domain/project/service/ProjectService.java index 3b67b8e..d8eec70 100644 --- a/backend/src/main/java/com/worlabel/domain/project/service/ProjectService.java +++ b/backend/src/main/java/com/worlabel/domain/project/service/ProjectService.java @@ -4,6 +4,7 @@ import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; import com.worlabel.domain.image.entity.Image; +import com.worlabel.domain.image.entity.LabelStatus; import com.worlabel.domain.image.repository.ImageRepository; import com.worlabel.domain.labelcategory.entity.ProjectCategory; import com.worlabel.domain.member.entity.Member; @@ -185,12 +186,15 @@ public class ProjectService { } // TODO: 트랜잭션 설정 + // TODO: 어떤 상황까지 덮어쓸껀지 물어보기 @Transactional public void saveAutoLabelList(final List resultList) { for(AutoLabelingResult result: resultList) { Image image = getImage(result.getImageId()); + if(image.getStatus() == LabelStatus.SAVE) continue; String dataPath = image.getDataPath(); s3UploadService.uploadJson(result.getData(), dataPath); + image.updateStatus(LabelStatus.IN_PROGRESS); } } From cf480633de18c6aab95a4321105955d8a779a643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=9A=A9=EC=88=98?= Date: Thu, 26 Sep 2024 01:34:58 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Refactor:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=EC=8B=9C=20COMPLETED=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/worlabel/domain/image/service/ImageService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java b/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java index f4e8ea2..4408114 100644 --- a/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java +++ b/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java @@ -255,7 +255,7 @@ public class ImageService { String dataPath = image.getDataPath(); s3UploadService.uploadJson(data, dataPath); - image.updateStatus(LabelStatus.IN_PROGRESS); + image.updateStatus(LabelStatus.COMPLETED); imageRepository.save(image); }