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(like) : 좋아요 기능 개발 #37

Merged
merged 7 commits into from
Jan 7, 2024
Merged

feat(like) : 좋아요 기능 개발 #37

merged 7 commits into from
Jan 7, 2024

Conversation

Woongbin06
Copy link
Contributor

🎫 관련 이슈

close #36


📄 개요

좋아요 기능을 만들었습니다.


🔨 작업 내용

  • 좋아요 생성 API를 만들었습니다.
  • 좋아요 삭제 API를 만들었습니다.
  • 좋아요 판별 여부 API를 만들었습니다.
  • QClass가 ignore되게 처리했습니다.

🏁 확인 사항

  • 테스트를 완료했나요?
  • API 문서를 작성했나요?
  • 코드 컨벤션을 준수했나요?
  • 불필요한 로그, 주석, import 등을 삭제했나요?

🙋🏻 덧붙일 말

@Woongbin06 Woongbin06 linked an issue Jan 5, 2024 that may be closed by this pull request
2 tasks
Comment on lines 28 to 38
public void createLike(Long qnAId, User user) {
QnA qnA = qnAReader.read(qnAId);
likeValidator.shouldBeAlreadyLike(qnA, user);
likeCreator.create(new Like(user, qnA));
}

public void deleteLike(Long qnAId, User user) {
QnA qnA = qnAReader.read(qnAId);
Like like = likeReader.read(qnA, user);
likeDeleter.delete(like);
}
Copy link
Member

Choose a reason for hiding this comment

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

LikeService니 함수이름을 creatLike로 하는 것 보다 create와 같이 작성하는게 간결해보입니다!

Comment on lines 18 to 24
public void shouldBeAlreadyLike(QnA qnA, User user) {
boolean isExist = likeRepository.existsByQnAAndUser(qnA, user);

if (isExist) {
throw new AlreadyLikeException();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

shouldBeAlreadyLike라는 함수 이름이 잘못된 것 같아요. 이 메서드는 좋아요가 이미 눌러져있다면 오류를 발행하는 함수이기 때문에 shouldNotExistLike 와 같은 이름이 적합해보입니다!

@Woongbin06 Woongbin06 requested a review from jacobhboy January 7, 2024 23:44
Copy link
Member

@jacobhboy jacobhboy left a comment

Choose a reason for hiding this comment

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

깔끼하네요 ㄷㄷ

@Woongbin06 Woongbin06 merged commit c743ed1 into master Jan 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

좋아요 기능 개발
2 participants