@@ -35,7 +35,7 @@ public class CommentService {
3535 @ Transactional
3636 public Comment create (Long postId , Long authorId , String content ) {
3737 Post post = findPostOrThrow (postId );
38- User author = findUserOrThrow (authorId );
38+ User author = userReader . findActiveUserById (authorId );
3939
4040 Comment comment = Comment .create (post , author , content );
4141 Comment savedComment = commentRepository .save (comment );
@@ -46,7 +46,7 @@ public Comment create(Long postId, Long authorId, String content) {
4646 @ Transactional
4747 public Comment reply (Long postId , Long authorId , Long parentId , Long mentionedUserId , String content ) {
4848 Post post = findPostOrThrow (postId );
49- User author = findUserOrThrow (authorId );
49+ User author = userReader . findActiveUserById (authorId );
5050 Comment requestedParent = findActiveCommentOrThrow (parentId );
5151
5252 if (!requestedParent .getPost ().getId ().equals (postId )) {
@@ -56,7 +56,7 @@ public Comment reply(Long postId, Long authorId, Long parentId, Long mentionedUs
5656 // 대댓글에 답글을 달면 트리 깊이를 2로 유지하기 위해 1뎁스 댓글로 정규화
5757 Comment actualParent = requestedParent .isReply () ? requestedParent .getParent () : requestedParent ;
5858
59- User mentionedUser = mentionedUserId != null ? findUserOrThrow (mentionedUserId ) : null ;
59+ User mentionedUser = mentionedUserId != null ? userReader . findActiveUserById (mentionedUserId ) : null ;
6060
6161 Comment reply = Comment .reply (post , author , actualParent , mentionedUser , content );
6262 Comment savedReply = commentRepository .save (reply );
@@ -98,10 +98,6 @@ private Post findPostOrThrow(Long postId) {
9898 .orElseThrow (() -> new GeneralException (ErrorStatus .POST_NOT_FOUND ));
9999 }
100100
101- private User findUserOrThrow (Long userId ) {
102- return userReader .findActiveUserById (userId );
103- }
104-
105101 private Comment findActiveCommentOrThrow (Long commentId ) {
106102 return commentRepository .findByIdAndDeletedFalse (commentId )
107103 .orElseThrow (() -> new GeneralException (ErrorStatus .COMMENT_NOT_FOUND ));
0 commit comments