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 구현 #34

Merged
merged 6 commits into from
Jan 7, 2024
Merged

[FEAT] 홈 API 구현 #34

merged 6 commits into from
Jan 7, 2024

Conversation

dong2ast
Copy link
Contributor

@dong2ast dong2ast commented Jan 6, 2024

📌 관련 이슈

closed #8

✨ 어떤 이유로 변경된 내용인지

  • 홈 조회 api를 구현했습니다.
  • 인기있는 레큐북 6개가 조회됩니다.
  • 테스트를 위한 InitDb Component를 구현했습니다.

🙏 검토 혹은 리뷰어에게 남기고 싶은 말

  • 인기있는 레큐북은 기획단에서 SQL로 수정을 할 수 있기를 원하기에 boolean 필드로 추가했습니다.
  • JPA에 limit 쿼리가 지원 안되기에 native 쿼리로 작성했습니다.
  • InitDb 데이터는 DB가 실행될 때 초기 데이터로 입력됩니다.

@dong2ast dong2ast added 🪄API 서버 API 통신 🧹Chore 동작에 영향 없는 코드 or 파일, 폴더 관련 수정사항 ✨Feat 새로운 기능 추가 동휘⚡️ labels Jan 6, 2024
@dong2ast dong2ast self-assigned this Jan 6, 2024
@dong2ast dong2ast linked an issue Jan 6, 2024 that may be closed by this pull request
1 task
@ddongseop ddongseop added the 🔥 Pull Request PR 날림 label Jan 6, 2024
Copy link
Member

@ddongseop ddongseop left a comment

Choose a reason for hiding this comment

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

사소한 오타를 제외하고는 완벽한것 같아요-!

Comment on lines 13 to 14
public class
Note extends BaseTimeEntity {
Copy link
Member

Choose a reason for hiding this comment

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

[P2] 여기 불필요한 엔터가 들어간 것 같아요! 수정 부탁드림당~

Comment on lines 11 to 12
@Query(value = "select b from Book b where b.isPopular = :isPopular")
List<Book> getAllByPopular(@Param("isPopular") Boolean isPopular, PageRequest pageRequest);
Copy link
Member

Choose a reason for hiding this comment

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

와우 Paging 쓰는거 처음보는데, 신기하군뇨~~

Copy link
Member

Choose a reason for hiding this comment

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

[P3] 혹시 여기 Book 뒤에 띄어쓰기 한번 더 들어간거 같은데 수정해주실 수 있나요~?

Comment on lines +62 to +74
public Book(String uuid, String favoriteName, String favoriteImage, String title, String description, int backgroundColor, Member member, boolean isPopular) {
this.uuid = uuid;
this.favoriteName = favoriteName;
this.favoriteImage = favoriteImage;
this.title = title;
this.description = description;
this.backgroundColor = backgroundColor;
this.member = member;
this.isPopular = isPopular;
}

public static Book of(String uuid, String favoriteName, String favoriteImage, String title, String description, int backgroundColor, Member member) {
return new Book(uuid, favoriteName, favoriteImage, title, description, backgroundColor, member);
public static Book of(String uuid, String favoriteName, String favoriteImage, String title, String description, int backgroundColor, Member member, boolean isPopular) {
return new Book(uuid, favoriteName, favoriteImage, title, description, backgroundColor, member, isPopular);
Copy link
Member

Choose a reason for hiding this comment

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

필드 추가 확인했습니당~


@Component
@RequiredArgsConstructor
public class InitDb {
Copy link
Member

Choose a reason for hiding this comment

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

InitDb 만드는거 귀찮은 작업인데,,, 맛있게 쓰겠습니다,,,

Copy link
Contributor

@eeddiinn eeddiinn left a comment

Choose a reason for hiding this comment

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

수고하셨습니당 ~~~~!!!👏👏

private final BookRepository bookRepository;

public List<Book> getPopularBook() {
return bookRepository.getAllByPopular(true, PageRequest.of(0, 6));
Copy link
Contributor

Choose a reason for hiding this comment

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

오호 PageRequest에 대해 새롭게 알고갑니다 !!!! 😁

Copy link
Member

@ddongseop ddongseop left a comment

Choose a reason for hiding this comment

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

헉 어프롭을 안했었네요 고고~~

# Conflicts:
#	src/main/java/org/sopt/lequuServer/domain/book/service/BookService.java
#	src/main/java/org/sopt/lequuServer/global/exception/enums/SuccessType.java
@dong2ast dong2ast merged commit 157f729 into develop Jan 7, 2024
1 check passed
@dong2ast dong2ast deleted the feat/#8-home_api branch January 7, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪄API 서버 API 통신 🧹Chore 동작에 영향 없는 코드 or 파일, 폴더 관련 수정사항 ✨Feat 새로운 기능 추가 동휘⚡️ 🔥 Pull Request PR 날림
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 홈 API 구현
3 participants