Skip to content

Commit

Permalink
🐛 [FIX] popularRate 쿼리에 포함 되도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ddongseop committed Mar 28, 2024
1 parent 7fe6df8 commit 3d08598
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/sopt/lequuServer/InitDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void dbInit() {
.description(bookDummy.getDescription())
.backgroundColor("#F5F5F5")
.member(member1)
.popularRate(0)
.build();
em.persist(book);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ public BookCreateResponseDto createBook(BookCreateRequestDto request, Long membe
String imageUrl = s3Service.getCloudFrontURL(BOOK_FAVORITE_IMAGE_FOLDER_NAME.getValue() + request.favoriteImage());

Book book = Book.builder()
.uuid(bookUuid)
.favoriteName(badWordFilterService.badWordChange(memberId, request.favoriteName()))
.favoriteImage(imageUrl)
.title(badWordFilterService.badWordChange(memberId, request.title()))
.description(badWordFilterService.badWordChange(memberId, request.description()))
.backgroundColor(request.backgroundColor())
.member(member)
.build();
.uuid(bookUuid)
.favoriteName(badWordFilterService.badWordChange(memberId, request.favoriteName()))
.favoriteImage(imageUrl)
.title(badWordFilterService.badWordChange(memberId, request.title()))
.description(badWordFilterService.badWordChange(memberId, request.description()))
.backgroundColor(request.backgroundColor())
.member(member)
.popularRate(0)
.build();

return bookService.createBook(book, member);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ public void addFavorite(Favorite favorite) {
private int popularRate;

@Builder
public Book(String uuid, String favoriteName, String favoriteImage, String title, String description, String backgroundColor, Member member) {
public Book(String uuid, String favoriteName, String favoriteImage, String title, String description, String backgroundColor, Member member, int popularRate) {
this.uuid = uuid;
this.favoriteName = favoriteName;
this.favoriteImage = favoriteImage;
this.title = title;
this.description = description;
this.backgroundColor = backgroundColor;
this.member = member;
this.popularRate = 0;
this.popularRate = popularRate;
}

public static Book of(String uuid, String favoriteName, String favoriteImage, String title, String description, String 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, String backgroundColor, Member member, int popularRate) {
return new Book(uuid, favoriteName, favoriteImage, title, description, backgroundColor, member, popularRate);
}
}

0 comments on commit 3d08598

Please sign in to comment.