Skip to content

Commit

Permalink
refactor : Default값 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
chws0508 committed Apr 22, 2024
1 parent 5ace067 commit cd4d0a3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ data class PostDetailResponse(
val type: PostTopicResponse,
val createDate: String,
val postImageUrls: List<String>,
val comments: List<CommentResponse> = emptyList(),
val comments: List<CommentResponse>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import com.withpeace.withpeace.core.ui.toUiModel
import java.time.LocalDateTime

data class CommentUiModel(
val id: Long = 0,
val content: String = "댓글 내용 입니다",
val id: Long,
val content: String,
val createDate: DateUiModel = DateUiModel(
LocalDateTime.now(),
),
val commentUser: CommentUserUiModel = CommentUserUiModel(),
val commentUser: CommentUserUiModel,
)

data class CommentUserUiModel(
val id: Long = 0,
val nickname: String = "위드피스",
val profileImageUrl: String = "",
val id: Long,
val nickname: String,
val profileImageUrl: String,
)

fun Comment.toUiModel() = CommentUiModel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import com.withpeace.withpeace.core.designsystem.ui.KeyboardAware
import com.withpeace.withpeace.core.designsystem.ui.WithPeaceBackButtonTopAppBar
import com.withpeace.withpeace.core.ui.DateUiModel
import com.withpeace.withpeace.core.ui.post.CommentUiModel
import com.withpeace.withpeace.core.ui.post.CommentUserUiModel
import com.withpeace.withpeace.core.ui.post.PostDetailUiModel
import com.withpeace.withpeace.core.ui.post.PostTopicUiModel
import com.withpeace.withpeace.core.ui.post.PostUserUiModel
Expand Down Expand Up @@ -416,7 +417,18 @@ private fun PostDetailScreenPreview() {
LocalDateTime.now(),
),
isMyPost = false,
comments = List(10) { CommentUiModel(id = it.toLong()) },
comments = List(10) {
CommentUiModel(
id = it.toLong(),
content = "natum",
createDate = DateUiModel(date = LocalDateTime.now()),
commentUser = CommentUserUiModel(
id = 9807,
nickname = "Becky Lowery",
profileImageUrl = "https://www.google.com/#q=repudiare",
),
)
},
),
),
lazyListState = rememberLazyListState(),
Expand Down

0 comments on commit cd4d0a3

Please sign in to comment.