Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : 게시글 좋아요, 좋아요 해제 구현 및 테스트코드 작성 #31

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

changhyun-jang
Copy link
Contributor

@changhyun-jang changhyun-jang commented Jul 14, 2024

#️⃣ 연관된 이슈 번호

close #25

📝 작업 내용

  • 사용자가 좋아요 버튼을 눌렀을 때, 해당 게시물의 좋아요 갯수가 증가하고 PostLike에 데이터가 생성되도록 구현했습니다.
  • 이때 발생할 수 있는 동시성이슈를 테스트 코드를 통해 확인하고 synchronous, 비관적 락, join등 여러 해결방안 중 현재 프로젝트 상황에 맞다고 생각한 비관적 락을 선택하여 해결하였습니다.
  • 차후 redis를 도입하면 그때 redis를 이용한 동시성 이슈 해결을 도입하겠습니다.
  • 사용자가 좋아요된 상태의 버튼을 눌렀을 때, 해당 게시물의 좋아요 갯수가 감소하고 PostLike에 데이터가 hardDelete되도록 구현했습니다.

💬 리뷰 요구사항

  • wrapper클래스를 사용하지 않은 부분들이 있거나 굳이 작성하지 않아도 되는 코드가 있다면 리뷰해주세요.

@changhyun-jang changhyun-jang changed the title [Refactor] 게시글 좋아요 삽입 구현 및 테스트코드 작성 feat : 게시글 좋아요 삽입 구현 및 테스트코드 작성 Jul 14, 2024
@songhyeon99 songhyeon99 added Type: Feature/Function 새로운 기능 및 개선 사항 Status: Reviewing 처리하고 리뷰 중인 이슈 labels Jul 21, 2024
@songhyeon99 songhyeon99 linked an issue Jul 21, 2024 that may be closed by this pull request
5 tasks
@changhyun-jang changhyun-jang changed the title feat : 게시글 좋아요 삽입 구현 및 테스트코드 작성 feat : 게시글 좋아요, 좋아요 해제 구현 및 테스트코드 작성 Jul 23, 2024
@changhyun-jang changhyun-jang merged commit 579dac9 into feature/post Jul 25, 2024
changhyun-jang added a commit that referenced this pull request Jul 26, 2024
* refactor : PostLike 엔터티 구현, Member엔터티 및 Post엔터티와 단방향 연관관계 설정, N:1

* fix : PostLike 기본키 생성 전략 설정 및 wrapper 타입 수정

* feat : 게시글 좋아요, 좋아요 해제 구현 및 테스트코드 작성 (#31)

* refactor : Post 좋아요 삽입 기능 구현, 동시성 이슈 해결을 위한 낙관적 Lock도입.

* refactor : Post 좋아요 삽입 기능에 대한 테스트 코드 작성

* fix : 엔드포인트 및 메소드명 수정

* feat : Post 좋아요 해제 기능 구현

* fix : 게시물 좋아요 기능 관련 api수정

* fix: ExceptionCode conflict 해결
@changhyun-jang changhyun-jang deleted the feature/postLike branch July 26, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewing 처리하고 리뷰 중인 이슈 Type: Feature/Function 새로운 기능 및 개선 사항
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat : 게시글 댓글 및 좋아요 기능 추가
2 participants