Skip to content

Conversation

@kfdsy0103
Copy link
Contributor

📌 관련 이슈

✨ PR 세부 내용

  • 게시글을 상세 조회하는 경우, 조회수가 증가하도록 하였습니다.

@kfdsy0103 kfdsy0103 added the ✨ feature 새로운 기능을 추가합니다 label Feb 5, 2025
@kfdsy0103 kfdsy0103 self-assigned this Feb 5, 2025
@kfdsy0103 kfdsy0103 linked an issue Feb 5, 2025 that may be closed by this pull request

Page<Post> findByWriter(User writer, Pageable pageable);

@Modifying
Copy link
Contributor

@redblackblossom redblackblossom Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 JPA 엔티티 수정으로 하시지 않고 직접 쿼리 날리신 이유가 있으신가요?

https://everydayyy.tistory.com/157

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

두 명이 동시에 조회하는 경우 조회수가 올라가지 않을 수도 있을 거 같아, db에서 직접 +1을 하도록 했습니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그런 경우는 쿼리를 날리는 것이 아니라 데이터베이스 락 같은 방법을 사용하셔야 합니다.

@redblackblossom redblackblossom self-requested a review February 6, 2025 13:28
@redblackblossom redblackblossom merged commit 8de031a into develop Feb 6, 2025
1 check passed
@redblackblossom redblackblossom deleted the feat/#152/view_count branch February 6, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature 새로운 기능을 추가합니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 게시글 상세 조회 시 조회수 증가 구현

3 participants