[Spring + Redis] 레디스로 게시글 조회수 중복 카운팅 검증하기
개인 프로젝트로 간단한 게시판을 만들고 있습니다. 누구나 하는 주제라서 쉽게 생각하고 덤볐다가 아주 고생하고 있습니다. ㅎㅎ 작성한 기능 중, 게시글을 조회하면 조회수가 하나 올라가는 기능이 있습니다. public PostResponse findOne(Long postId) { Post post = postRepository.findByIdWithUser(postId). orElseThrow(() -> new IllegalArgumentException("해당하는 postId가 없습니다. 잘못된 입력")); int recommendCount = postRecommendRepository.countByPostId(postId); post.increaseHitCount(); List comments = co..
2022.07.27