From 5eb111dff5edea171974c90ccf340bccafb30876 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Fri, 6 Sep 2024 17:01:16 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=EB=AF=B8=EC=85=98=EA=B8=80,=20?= =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=8B=A0=EA=B3=A0=20API=20=EC=84=A4?= =?UTF-8?q?=EA=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FarmClubController.java | 18 ++++++++++++++++++ .../farmclub/service/MissionPostService.java | 15 +++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java index ab0bb1f..0b2fee7 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java @@ -180,4 +180,22 @@ public BaseResponseDto successFarmClub( ) { return BaseResponseDto.of(SuccessCode.SUCCESS, farmClubService.successFarmClub(farmClubId, user.getUserId())); } + + @PostMapping("/report/mission/{missionPostId}") + public BaseResponseDto reportMissionPost( + @AuthenticationPrincipal CustomUser user, + @PathVariable Long missionPostId + ) { + missionPostService.reportMissionPost(user.getUserId(), missionPostId); + return BaseResponseDto.of(SuccessCode.SUCCESS, null); + } + + @PostMapping("/report/comment/{commentId}") + public BaseResponseDto reportMissionPostComment( + @AuthenticationPrincipal CustomUser user, + @PathVariable Long commentId + ) { + missionPostService.reportMissionPostComment(user.getUserId(), commentId); + return BaseResponseDto.of(SuccessCode.SUCCESS, null); + } } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java index 334d0ec..74bc79f 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/MissionPostService.java @@ -7,7 +7,6 @@ import com.modernfarmer.farmusspring.domain.farmclub.helper.MissionPostHelper; import com.modernfarmer.farmusspring.domain.farmclub.helper.UserFarmClubHelper; import com.modernfarmer.farmusspring.domain.farmclub.repository.MissionPostRepository; -import com.modernfarmer.farmusspring.domain.farmclub.vo.MissionPostCommentVo; import com.modernfarmer.farmusspring.domain.farmclub.vo.MissionPostVo; import com.modernfarmer.farmusspring.domain.user.entity.User; import com.modernfarmer.farmusspring.domain.user.helper.UserHelper; @@ -74,7 +73,19 @@ public GetMissionPostListResponseDto getMissionPostList(Long userId, Long farmCl } public GetMissionPostCommentResponseDto getMissionPostComment(Long missionPostId, Long userId) { - return missionPostHelper.getMissionPostComment(missionPostId, userId); + return missionPostHelper.getMissionPostComments(missionPostId, userId); + } + + @Transactional + public void reportMissionPost(Long userId, Long missionPostId) { + MissionPost missionPost = missionPostHelper.getMissionPost(missionPostId); + + } + + @Transactional + public void reportMissionPostComment(Long userId, Long missionPostCommentId) { + MissionPostComment missionPostComment = missionPostHelper.getMissionPostComment(missionPostCommentId); + } private MissionPost saveMissionPost(MissionPost missionPost) {