From 5e4dbd8a40f23bea2d0540e0ae3a06a735ad46f7 Mon Sep 17 00:00:00 2001 From: minsun Date: Thu, 7 Dec 2023 02:08:26 +0900 Subject: [PATCH] =?UTF-8?q?refactor(PostCrudService):=20=ED=8F=AC=ED=86=A0?= =?UTF-8?q?=EC=B9=B4=EB=93=9C=20=EC=A0=80=EC=9E=A5=EC=95=88=EB=90=A8=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=EC=88=98=EC=A0=95=20(@Trancational=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/myadd/myadd/post/crud/service/PostCrudService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/myadd/myadd/post/crud/service/PostCrudService.java b/src/main/java/com/myadd/myadd/post/crud/service/PostCrudService.java index fdc50f7..a9ce2a4 100644 --- a/src/main/java/com/myadd/myadd/post/crud/service/PostCrudService.java +++ b/src/main/java/com/myadd/myadd/post/crud/service/PostCrudService.java @@ -13,14 +13,13 @@ import java.io.IOException; @Service -@Transactional @RequiredArgsConstructor @Slf4j public class PostCrudService { private final PostCrudRepository postCrudRepository; private final FileUploadService fileUploadService; - @Transactional + public PostEntity savePost(PostBackDto postDto, MultipartFile image, Long id) throws IOException { if(!image.isEmpty()) { String storedFileName = fileUploadService.upload(image); @@ -31,7 +30,7 @@ public PostEntity savePost(PostBackDto postDto, MultipartFile image, Long id) th } - @Transactional + public boolean deletePost(Long postId) { PostEntity postEntity = postCrudRepository.findByPostId(postId); @@ -49,7 +48,7 @@ public boolean deletePost(Long postId) { } - @Transactional + public PostEntity modifyPost(Long postId, PostBackDto postDto, MultipartFile image, Long id) throws IOException { PostEntity postEntity = postCrudRepository.findByPostId(postId);