Skip to content

Conversation

@gogori6565
Copy link
Contributor

@gogori6565 gogori6565 commented Jan 6, 2026

📣 Related Issue

📝 Summary

기록(게시글)에 대한 공감 토글 API를 구현하였습니다.

  • 해당 API 하나로 공감 수정/삭제가 가능합니다.
    • 한 사용자가 같은 게시글에 하나의 공감만 등록할 수 있음
    • 사용자가 해당 게시글에 누른 "같은 공감 유형"이 있다면(또 누른 경우) -> 공감 삭제
    • 사용자가 해당 게시글에 누른 "다른 공감 유형"이 있다면 -> 공감 유형 수정
  • 성능 최적화를 위해 Post 테이블에 각 공감 유형의 개수를 카운트하여 미리 저장해두었습니다. (매번 계산하지 않아도 됨)

📬 Reference

Likes 테이블 데이터 저장 시
image


Post 테이블 구조
image

Copy link
Member

@rhkr8521 rhkr8521 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

@rhkr8521 rhkr8521 merged commit 89a93b5 into develop Jan 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 공감 토글 API 구현

3 participants