-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#231 Refactor: 와인 정보, 리뷰 볼 때 좋아요 여부 같이 반환
- Loading branch information
1 parent
bb0f2fc
commit 22bef0d
Showing
9 changed files
with
101 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/com/drinkeg/drinkeg/wine/dto/response/WineReviewDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.drinkeg.drinkeg.wine.dto.response; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class WineReviewDTO { | ||
|
||
// 회원이 설정한 이름 | ||
private String name; | ||
|
||
private String review; | ||
|
||
private float satisfaction; | ||
|
||
|
||
@QueryProjection | ||
public WineReviewDTO(String name, String review, float satisfaction) { | ||
this.name = name; | ||
this.review = review; | ||
this.satisfaction = satisfaction; | ||
} | ||
|
||
} |
27 changes: 15 additions & 12 deletions
27
src/main/java/com/drinkeg/drinkeg/wine/dto/response/WineReviewResponseDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
package com.drinkeg.drinkeg.wine.dto.response; | ||
|
||
import com.drinkeg.drinkeg.tastingNote.dto.response.TastingNotePreviewResponseDTO; | ||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Builder | ||
public class WineReviewResponseDTO { | ||
|
||
// 회원이 설정한 이름 | ||
private String name; | ||
|
||
private String review; | ||
|
||
private float satisfaction; | ||
|
||
List<WineReviewDTO> wineReviews; | ||
boolean isLiked; | ||
|
||
@QueryProjection | ||
public WineReviewResponseDTO(String name, String review, float satisfaction) { | ||
this.name = name; | ||
this.review = review; | ||
this.satisfaction = satisfaction; | ||
public WineReviewResponseDTO(List<WineReviewDTO> wineReviews, boolean isLiked) { | ||
this.wineReviews = wineReviews; | ||
this.isLiked = isLiked; | ||
} | ||
|
||
public static WineReviewResponseDTO create(List<WineReviewDTO> wineReviews, boolean isLiked){ | ||
return WineReviewResponseDTO.builder() | ||
.wineReviews(wineReviews) | ||
.isLiked(isLiked) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters