-
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.
Merge pull request #109 from LeeSM0518/DVK-123-edit-review-list-view
[DVK-123] fix: 리뷰 목록 조회 수정
- Loading branch information
Showing
13 changed files
with
117 additions
and
30 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
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
4 changes: 3 additions & 1 deletion
4
src/main/kotlin/com/devooks/backend/review/v1/dto/CreateReviewResponse.kt
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,12 +1,14 @@ | ||
package com.devooks.backend.review.v1.dto | ||
|
||
import com.devooks.backend.member.v1.domain.Member | ||
import com.devooks.backend.review.v1.domain.Review | ||
import com.devooks.backend.review.v1.dto.ReviewView.Companion.toReviewView | ||
|
||
data class CreateReviewResponse( | ||
val review: ReviewView, | ||
) { | ||
companion object { | ||
fun Review.toCreateReviewResponse() = CreateReviewResponse(this.toReviewView()) | ||
fun Review.toCreateReviewResponse(member: Member) = | ||
CreateReviewResponse(this.toReviewView(member)) | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
src/main/kotlin/com/devooks/backend/review/v1/dto/ModifyReviewResponse.kt
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,12 +1,14 @@ | ||
package com.devooks.backend.review.v1.dto | ||
|
||
import com.devooks.backend.member.v1.domain.Member | ||
import com.devooks.backend.review.v1.domain.Review | ||
import com.devooks.backend.review.v1.dto.ReviewView.Companion.toReviewView | ||
|
||
class ModifyReviewResponse( | ||
val review: ReviewView | ||
val review: ReviewView, | ||
) { | ||
companion object { | ||
fun Review.toModifyReviewResponse() = ModifyReviewResponse(this.toReviewView()) | ||
fun Review.toModifyReviewResponse(member: Member) = | ||
ModifyReviewResponse(this.toReviewView(member)) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/devooks/backend/review/v1/dto/ReviewRow.kt
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,17 @@ | ||
package com.devooks.backend.review.v1.dto | ||
|
||
import java.time.Instant | ||
import java.util.* | ||
|
||
data class ReviewRow( | ||
val reviewId: UUID, | ||
val content: String, | ||
val rating: Int, | ||
val ebookId: UUID, | ||
val memberId: UUID, | ||
val nickname: String, | ||
val profileImagePath: String?, | ||
val writtenDate: Instant, | ||
val modifiedDate: Instant, | ||
val commentCount: Int, | ||
) |
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/kotlin/com/devooks/backend/review/v1/dto/WriterView.kt
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.devooks.backend.review.v1.dto | ||
|
||
import com.devooks.backend.member.v1.domain.Member | ||
import java.util.* | ||
|
||
data class WriterView( | ||
val memberId: UUID, | ||
val nickname: String, | ||
val profileImagePath: String, | ||
) { | ||
companion object { | ||
fun ReviewRow.toWriterView() = | ||
WriterView( | ||
memberId = this.memberId, | ||
nickname = this.nickname, | ||
profileImagePath = this.profileImagePath ?: "", | ||
) | ||
|
||
fun Member.toWriterView() = | ||
WriterView( | ||
memberId = this.id, | ||
nickname = this.nickname, | ||
profileImagePath = this.profileImagePath, | ||
) | ||
} | ||
} |
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