feat: 추천 기능 추상화로 post 에 대한 의존성 제거 #35
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ 작업 내용
Recommendable인터페이스를 작성하였고, 이를 구현하는 Type(post, review, comment)을 모두 받는 제네릭 메서드를 이용하여 재사용성을 높였습니다.recommender_id(추천인),type(게시 유형)target_id(게시글 id) 값으로 유니크 제약조건이 걸려있습니다.추천
추천 취소(같은 메서드 한 번 더 호출)
추천 수 조회