Skip to content

Commit

Permalink
게시글, 댓글에 프로필사진 보여주기 (#78)
Browse files Browse the repository at this point in the history
* PostDto, Post에 프로필사진 url 추가

* 게시글 프로필사진 보여주기

* CommentDto, Comment에 프로필사진 url 추가

* 댓글애 프로필사진 보여주기
  • Loading branch information
eastshine2741 committed Aug 30, 2024
1 parent 33ac85f commit 9a7f800
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fun PostHeader(
.height(IntrinsicSize.Min),
verticalAlignment = Alignment.CenterVertically
) {
CommunityProfilePicture(model = null) // TODO: 서버에서 프로필이미지 내려주면 반영하기
CommunityProfilePicture(model = post.profilePicture)
Spacer(modifier = Modifier.width(8.dp))
Column(
modifier = Modifier
Expand Down Expand Up @@ -430,7 +430,7 @@ fun CommentItem(
verticalAlignment = Alignment.CenterVertically
) {
CommunityProfilePicture(
model = null,
model = comment.profilePicture,
modifier = Modifier.size(16.dp)
)
Spacer(modifier = Modifier.width(5.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ data class Comment(
val updatedAt: LocalDateTime = LocalDateTime.MIN,
val id: Long = 0L,
val nickname: String = "",
val profilePicture: String? = null,
val available: Boolean = true,
val anonymous: Boolean = true,
val isMine: Boolean = false,
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/wafflestudio/siksha2/models/Post.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data class Post(
val updatedAt: LocalDateTime = LocalDateTime.MIN,
val id: Long = 0L,
val nickname: String = "",
val profilePicture: String? = null,
val available: Boolean = true,
val anonymous: Boolean = true,
val isMine: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ data class CommentDto(
val updated_at: String = "",
val id: Long = 0L,
val nickname: String? = "",
val profile_url: String?,
val available: Boolean = true,
val anonymous: Boolean = true,
val is_mine: Boolean = false,
Expand All @@ -25,6 +26,7 @@ data class CommentDto(
updatedAt = updated_at.toLocalDateTime(),
id = id,
nickname = nickname ?: "익명",
profilePicture = profile_url,
available = available,
anonymous = anonymous,
isMine = is_mine,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ data class PostDto(
@Json(name = "updated_at") val updatedAt: String = "",
@Json(name = "id") val id: Long = 0L,
@Json(name = "nickname") val nickname: String? = "",
@Json(name = "profile_url") val profileUrl: String?,
@Json(name = "available") val available: Boolean = true,
@Json(name = "anonymous") val anonymous: Boolean = true,
@Json(name = "is_mine") val isMine: Boolean = false,
Expand All @@ -31,6 +32,7 @@ data class PostDto(
updatedAt = updatedAt.toLocalDateTime(),
id = id,
nickname = nickname ?: "익명",
profilePicture = profileUrl,
available = available,
anonymous = anonymous,
isMine = isMine,
Expand Down

0 comments on commit 9a7f800

Please sign in to comment.