Skip to content

Conversation

@sansan20535
Copy link
Member

🔥Pull requests

⛳️ 작업한 브랜치

👷 작업한 내용

  • 신고하기 API를 구현했습니다.

🚨 참고 사항

  • 신고 타입을 Enum으로 만드는 과정에서 커뮤니티 신고라면 굳이 ERD 설계처럼 Enum으로 저장이 필요없을 것 같다고 생각했고, Enum을 Report에 저장하게 된다면 이후 리뷰, 댓글, 대댓글 신고 기능이 추가될 때 파라미터만 바꿔서 요청 받으면 하나의 API에서 처리할 수 있다고 생각했습니다! 이 부분에 대한 연진님의 의견은 어떠신지가 궁금합니다!

  • 위의 고려사항에 따라 다음과 같이 변경을 했습니다.

  1. ReportType Enum타입을 총 4개(댓글, 대댓글, 게시글, 병원 리뷰)로 구별했습니다.
  2. 클라이언트 분들께 요청받는 값을 기존의 postId 하나에서 targetId, ReportType을 추가로 받도록 했습니다.
  3. url은 기존 /posts/{postId}/report 에서 /reports/{targetId}로 수정했습니다.

@sansan20535 sansan20535 added the 🍀feat 기능 개발 label Apr 4, 2025
@sansan20535 sansan20535 requested a review from seoyeonjin April 4, 2025 09:57
@sansan20535 sansan20535 self-assigned this Apr 4, 2025
Copy link
Collaborator

@seoyeonjin seoyeonjin left a comment

Choose a reason for hiding this comment

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

신고 타입을 Enum으로 만드는 과정에서 커뮤니티 신고라면 굳이 ERD 설계처럼 Enum으로 저장이 필요없을 것 같다고 생각했고, Enum을 Report에 저장하게 된다면 이후 리뷰, 댓글, 대댓글 신고 기능이 추가될 때 파라미터만 바꿔서 요청 받으면 하나의 API에서 처리할 수 있다고 생각했습니다! 이 부분에 대한 연진님의 의견은 어떠신지가 궁금합니다!

이 부분 api에서도 enum으로 처리하도록 변경한다는 얘기가 맞을까요? api endpoint 변경한 점 좋습니다! 확장도 더 용이할 것 같습니다.

private final ReportRepository reportRepository;

@Transactional
public void addReport(final Long memberId, final Long targetId, final ReportType reportType) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

p2;

지금은 해당하는 post id가 존재하지 않아도 해당 post에 대해 report가 가능한 구조인데, 해당 id가 유효한 id인지 확인하는 로직이 추가되면 좋을 것 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

이 부분에 대해서 Controller 단에서 커스텀 어노테이션으로 구분을 할지, 아니면 서비스 단에서 처리를 할지 등등도 논의하면 좋을 것 같습니다!

@sansan20535
Copy link
Member Author

이 부분 api에서도 enum으로 처리하도록 변경한다는 얘기가 맞을까요? api endpoint 변경한 점 좋습니다! 확장도 더 용이할 것 같습니다.

네네! Converter를 추가를 하지 않은 것 같은데 추가하도록 하겠습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍀feat 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: 커뮤니티 신고 API 구현

3 participants