From 1852ac05565a7c5576c35d4a5efb487e733edecc Mon Sep 17 00:00:00 2001 From: jgmoon <6813821@tukorea.ac.kr> Date: Thu, 15 Feb 2024 16:24:40 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=BF=80=ED=8C=81=EA=B3=B5=EC=9C=A0?= =?UTF-8?q?=ED=95=B4=EC=9A=94=20=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EB=B0=8F=20=EC=82=AD=EC=A0=9C=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(#63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../post/service/HoneyTipPostService.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/api/ttoklip/domain/honeytip/post/service/HoneyTipPostService.java b/src/main/java/com/api/ttoklip/domain/honeytip/post/service/HoneyTipPostService.java index 94473d77..9a37834d 100644 --- a/src/main/java/com/api/ttoklip/domain/honeytip/post/service/HoneyTipPostService.java +++ b/src/main/java/com/api/ttoklip/domain/honeytip/post/service/HoneyTipPostService.java @@ -4,6 +4,7 @@ import com.api.ttoklip.domain.common.report.dto.ReportCreateRequest; import com.api.ttoklip.domain.common.report.service.ReportService; +import com.api.ttoklip.domain.honeytip.Scrap.service.HoneyTipScrapService; import com.api.ttoklip.domain.honeytip.comment.domain.HoneyTipComment; import com.api.ttoklip.domain.honeytip.image.service.HoneyTipImageService; import com.api.ttoklip.domain.honeytip.like.service.HoneyTipLikeService; @@ -37,6 +38,7 @@ public class HoneyTipPostService { private final HoneyTipUrlService honeyTipUrlService; private final HoneyTipImageService honeyTipImageService; private final HoneyTipLikeService honeyTipLikeService; + private final HoneyTipScrapService honeyTipScrapService; private final HoneyTipCommonService honeyTipCommonService; @@ -215,4 +217,18 @@ public Message cancelLike(final Long postId) { /* -------------------------------------------- 좋아요 추가 & 취소 끝 -------------------------------------------- */ + /* -------------------------------------------- 스크랩 추가 & 취소 -------------------------------------------- */ + @Transactional + public Message registerScrap(Long postId) { + honeyTipScrapService.registerScrap(postId); + return Message.scrapPostSuccess(HoneyTip.class, postId); + } + + @Transactional + public Message cancelScrap(Long postId){ + honeyTipScrapService.cancelScrap(postId); + return Message.scrapPostCancel(HoneyTip.class, postId); + } + /* -------------------------------------------- 스크랩 추가 & 취소 끝 -------------------------------------------- */ + }