Skip to content

Commit

Permalink
[Refactor] 댓글 수 설정 임시 메소드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Aug 6, 2024
1 parent 5cf89da commit 40c428a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,4 @@ public ResponseEntity<ResponseDto<Integer>> likePost(@AuthenticationPrincipal Me
return ResponseEntity.ok(ResponseDto.of(replyService.likeReply(member,replyId),"게시글 좋아요 여부 변경성공"));
}

@GetMapping("/set")
public void setReplyCount(){
replyService.setReplyCount();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ public class ReplyService {
private final PostRepository postRepository;
private final LikeReplyRepository likeReplyRepository;

@Transactional
public void setReplyCount(){
List<Post> posts = postRepository.findAll();
for(Post post :posts){
long size = post.getReplies().size();
post.setReplyCount(size);
}
}

@Transactional
public Long saveReply(Member member, ReplyDto replyDto, Long postId){
Post post = postRepository.findById(postId).orElseThrow(()->new MyException(MyErrorCode.POST_NOT_FOUND));
Expand Down

0 comments on commit 40c428a

Please sign in to comment.