Class CommentService


  • @Service
    public class CommentService
    extends java.lang.Object
    댓글 서비스.
    Version:
    1.0
    Author:
    always0ne
    • Constructor Detail

      • CommentService

        public CommentService()
    • Method Detail

      • saveComment

        @Transactional
        public void saveComment​(java.lang.Long postId,
                                java.lang.String requestUserId,
                                AddCommentRequest addCommentRequest)
        댓글 입력.
        Parameters:
        postId - 게시글 ID
        requestUserId - 요청한 사용자 ID
        addCommentRequest - 댓글 작성 요청
        Throws:
        PostNotFoundException - 존재하지 않는 게시글입니다.
      • updateComment

        @Transactional
        public void updateComment​(java.lang.Long postId,
                                  java.lang.Long commentId,
                                  java.lang.String requestUserId,
                                  UpdateCommentRequest updateCommentRequest)
        댓글 수정.
        Parameters:
        postId - 게시글 ID
        commentId - 댓글 ID
        requestUserId - 요청한 사용자 ID
        updateCommentRequest - 댓글 수정 요청
        Throws:
        PostNotFoundException - 존재하지 않는 게시글입니다.
        ThisIsNotYoursException - 수정권한이 없습니다.
      • deleteComment

        @Transactional
        public void deleteComment​(java.lang.Long postId,
                                  java.lang.Long commentId,
                                  java.lang.String requestUserId)
        댓글 삭제.
        Parameters:
        postId - 게시글 ID
        commentId - 댓글 ID
        requestUserId - 요청한 사용자 ID
        Throws:
        PostNotFoundException - 존재하지 않는 게시글입니다.
        ThisIsNotYoursException - 수정권한이 없습니다.
      • getMyComment

        public Comment getMyComment​(java.lang.Long commentId,
                                    java.lang.String requestUserId)
        내 댓글 가져오기.
        Parameters:
        commentId - 댓글 ID
        requestUserId - 요청한 사용자 ID
        Returns:
        댓글 엔터티
        Throws:
        ThisIsNotYoursException - 수정권한이 없습니다.