Skip to content

Commit

Permalink
feat : 메모 존재 여부 필드 추가 (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlswns2480 authored Dec 22, 2024
1 parent ec506e7 commit 2d34a60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data class ContentsResponse(
val thumbNail: String,
val isFavorite: Boolean,
val keyword: String,
val memoExists: Boolean,
)

fun ContentsResult.toResponse(): ContentsResponse {
Expand All @@ -35,5 +36,6 @@ fun ContentsResult.toResponse(): ContentsResponse {
thumbNail = this.thumbNail,
isFavorite = this.isFavorite,
keyword = this.keyword,
memoExists = this.memoExists,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ data class ContentsResult(
val isRead: Boolean,
val thumbNail: String,
val isFavorite: Boolean,
val keyword: String
val keyword: String,
val memoExists: Boolean,
) {
companion object {
fun of(
Expand All @@ -39,7 +40,8 @@ data class ContentsResult(
isRead = isRead > 0,
thumbNail = content.thumbNail ?: ContentDefault.THUMB_NAIL,
isFavorite = isFavorite > 0,
keyword = keyword
keyword = keyword,
memoExists = content.memo.isNotBlank(),
)
}
}
Expand Down

0 comments on commit 2d34a60

Please sign in to comment.