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] 족보 주인인지 여부 리턴하는 API 구현 #229

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

PicturePark1101
Copy link
Contributor

@PicturePark1101 PicturePark1101 commented Dec 14, 2024

Related Issue 📌

close #228

Description ✔️

  • 족보 주인인지 여부 리턴하는 API 구현

To Reviewers

  • 공유 화면으로 진입할 때 최초로 호출되는 API라 404 Excepion 잡아주기 위해 Exists 쿼리 사용하지 않았습니다.
  • 로컬DB 테스트 완료
  • 족보 주인이면 true, 아니면 false 리턴
  • 아래 함수에서 연쇄적으로 get을 호출하는게 거슬리는데 User를 리턴하도록 바꾼다음에 IsOnwer에서 분해하는게 나을지.... 의견부탁드립니다
  private long getOwnerIdById(final long id) {
    return favoriteFinder.findById(id).getUser().getId();
  }

  private boolean isOwner(final long ownerId, final long userId) {
    return ownerId == userId;
  }

@PicturePark1101 PicturePark1101 merged commit 38b8525 into develop Dec 17, 2024
1 check passed
@PicturePark1101 PicturePark1101 deleted the feat/228 branch December 17, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 공유 족보가 내 족보인지 판별하는 API
2 participants