-
Notifications
You must be signed in to change notification settings - Fork 1
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 #55 from Team-Walkie/compose/mypage
내가 작성한 글 확인하기 기능 구현
- Loading branch information
Showing
20 changed files
with
299 additions
and
72 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
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
20 changes: 20 additions & 0 deletions
20
data/src/main/java/com/whyranoid/data/model/account/UserResponse.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,20 @@ | ||
package com.whyranoid.data.model.account | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import com.whyranoid.domain.model.user.User | ||
|
||
data class UserResponse( | ||
@SerializedName("walkieId") val uid: Long, | ||
@SerializedName("nickname") val nickname: String, | ||
@SerializedName("profileImg") val profileImg: String, | ||
@SerializedName("status") val status: String, | ||
) { | ||
fun toUser(): User { | ||
return User( | ||
uid, | ||
status, | ||
nickname, | ||
profileImg, | ||
) | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
data/src/main/java/com/whyranoid/data/model/post/PostResponse.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,38 @@ | ||
package com.whyranoid.data.model.post | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import com.whyranoid.data.model.account.UserResponse | ||
import com.whyranoid.domain.model.post.PostPreview | ||
import com.whyranoid.domain.model.post.TextVisibleState | ||
import com.whyranoid.domain.util.dateFormatter | ||
|
||
data class PostResponse( | ||
@SerializedName("viewerId") val viewerId: Long, | ||
@SerializedName("poster") val poster: UserResponse, | ||
@SerializedName("postId") val postId: Long, | ||
@SerializedName("liked") val liked: Boolean, | ||
@SerializedName("likers") val likers: List<UserResponse>, | ||
@SerializedName("photo") val photo: String, | ||
@SerializedName("content") val content: String, | ||
@SerializedName("date") val date: String, | ||
@SerializedName("colorMode") val colorMode: Long, | ||
@SerializedName("historyContent") val historyContent: String, | ||
) { | ||
fun toPostPreview(): PostPreview { | ||
val destructedHistoryContent = historyContent.split('_') | ||
println(destructedHistoryContent) | ||
return PostPreview( | ||
author = poster.toUser(), | ||
id = this.poster.uid, | ||
isLiked = this.liked, | ||
likers = this.likers.map { it.toUser() }, | ||
imageUrl = this.photo, | ||
date = dateFormatter.parse(this.date.replace("T", " ")).time, | ||
textVisibleState = TextVisibleState.values()[this.colorMode.toInt()], | ||
distanceText = destructedHistoryContent[2], | ||
timeText = destructedHistoryContent[3], | ||
paceText = destructedHistoryContent[4], | ||
address = destructedHistoryContent[1], | ||
) | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
domain/src/main/java/com/whyranoid/domain/model/post/PostPreview.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
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
Oops, something went wrong.