Skip to content

Commit

Permalink
[feat] 미션글, 댓글 신고 API 설계
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchoGreenT committed Sep 6, 2024
1 parent 89619d7 commit 5eb111d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5eb111d

Please sign in to comment.