-
Notifications
You must be signed in to change notification settings - Fork 0
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
[FEAT] 답변 공감 기능 #31
Conversation
중복 공감 시, Conflict 발생하는 기능도 구현 완료
answerService.likeAnswerById(memberId, answerId) | ||
return ApiResponse.success() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
서비스 메서드 네이밍 수정하면 좋을 것 같아요. byId 만 봤을 때는 파라미터로 하나의 id 만 들어가는 것처럼 보일 수 있을 것 같아요. createLike 와 같은 네이밍은 어떨지 의견 남겨봅니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createLike로 변경하겠습니다!
answerService.dislikeAnswerById(memberId, answerId) | ||
return ApiResponse.success() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 같은 맥락으로 네이밍 한번 고려해봐주세요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createLike / deleteLike 어떨까요?-?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteLike좋습니다 ! 변경해썽요:)
answerService.dislikeAnswerById(memberId, answerId) | ||
return ApiResponse.success() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createLike / deleteLike 어떨까요?-?
} | ||
|
||
@Auth | ||
@Operation(summary = "[인증] 답변 공감") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기두 명세서와 같이 [인증] 질문 답변 공감 이렇게 바꿔주면 좋을 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문 답변 공감이라는 단어가 약간 애매해서 답변 공감으로 했는데요 제가 톡방에 올려보겠습니다
} | ||
|
||
@Auth | ||
@Operation(summary = "[인증] 답변 공감 취소") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 명세서와 동일하게 바꾸는 건 어떨지 고려해봐주세요!
return likeRepository.findLikeByMemberAndAnswerAndQuestion(member = member, answer = answer, question = question) | ||
?: throw NotFoundException(ErrorCode.NOT_FOUND_LIKE_EXCEPTION, "존재하지 않는 공감 입니다") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validator로 옮겨서 처리해주는건 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 그래야 할 것 같네용 감사합니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validator로 옮겨서 처리해주는건 어떨까요?
근데 다른 Explorer 로직 확인하면 조회에서 NotFound 체크해주고
Validator는 특정 검증작업이 필요한 경우에만 사용되는 거 같습니다.
조회기능에서 사용되는 NotFound 검증 책임을 Validator로 위임하면 똑같은 조회 쿼리가 2번 발생하게 됩니다.
NotFound 처리는 Explorer에 두는 거 어떠신가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋아요!
fun findQuestionById(id: Long): Question { | ||
return questionRepository.findQuestionById(id) | ||
?: throw NotFoundException(ErrorCode.NOT_FOUND_QUESTION_EXCEPTION, "존재하지 않는 질문(ID: $id) 입니다") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 한번 고려해봐주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에 답변 내용 부탁드립니다!
✒️ 관련 이슈번호
🔑 Key Changes
📸 Screenshot
📢 To Reviewers