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

[Refactor] Book 등록 API 수정 #26

Merged
merged 3 commits into from
Mar 23, 2024

Conversation

jwooo
Copy link
Member

@jwooo jwooo commented Mar 23, 2024

💡 연관된 이슈

close #22

📝 작업 내용

  • Bookurl 필드가 imageUrl 필드로 변경
  • 변경으로 인한 문제 해결
  • Crawler를 통한 도서 등록 기능 구현

💬 리뷰 요구 사항

책 등록시 평점은 반드시 0.0이게 됩니다.

그래서 도서 등록시 사용되는 of(Book book, Double avg)메서드를 오버라이딩 하여 of(Book book) 메서드를 생성했습니다. 그리고 해당 메서드에서 기본 값으로 0.0을 설정 해주었습니다.

public static BookResponse of(Book book) {
  return BookResponse.builder()
          .title(book.getTitle())
          .content(book.getContent())
          .authors(book.getAuthors())
          .isbn(book.getIsbn())
          .publisher(book.getPublisher())
          .dateTime(book.getDateTime())
          .thumbnail(book.getThumbnail())
          .imageUrl(book.getImageUrl())
          .ratingAverage(0.0)
          .build();
}

좀 더 좋은 방식이 있을 것 같은데 좋은 방법이 있을까요?

@jwooo jwooo added the 🔨 Refactor 코드 리팩토링 label Mar 23, 2024
@jwooo jwooo requested review from pdohyung and AHNYUNKI March 23, 2024 10:43
@jwooo jwooo self-assigned this Mar 23, 2024
@jwooo jwooo linked an issue Mar 23, 2024 that may be closed by this pull request
2 tasks
Copy link
Member

@pdohyung pdohyung left a comment

Choose a reason for hiding this comment

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

변경 사항 확인했습니다.

좀 더 좋은 방식이 있을 것 같은데 좋은 방법이 있을까요?

책 등록 시 평점은 0으로 초기화되는 것이 당연하다고 생각합니다.
그래서 지금 방법이 최선이라고 느껴집니다.

수고하셨습니다 👍

Copy link
Member

@AHNYUNKI AHNYUNKI left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~
저도 도형님 의견에 동의합니다!

@jwooo
Copy link
Member Author

jwooo commented Mar 23, 2024

넵 알겠습니다. 머지 하겠습니다!!

@jwooo jwooo merged commit 6827d03 into develop Mar 23, 2024
1 check passed
@jwooo jwooo deleted the refector/22-refector-book-create-api branch March 23, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 Refactor 코드 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refector] Book 등록 API 수정
3 participants