-
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 #67 from Team-Walkie/compose/community
유저 프로필 세부 구현 및 네비게이션 연결
- Loading branch information
Showing
24 changed files
with
312 additions
and
146 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
34 changes: 15 additions & 19 deletions
34
data/src/main/java/com/whyranoid/data/datasource/UserDataSourceImpl.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
9 changes: 8 additions & 1 deletion
9
data/src/main/java/com/whyranoid/data/datasource/community/CommunityService.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,15 +1,22 @@ | ||
package com.whyranoid.data.datasource.community | ||
|
||
import com.whyranoid.data.API | ||
import com.whyranoid.data.model.account.NickProfileResponse | ||
import com.whyranoid.data.model.community.request.PostLikeRequest | ||
import com.whyranoid.data.model.community.response.PostLikeResponse | ||
import retrofit2.Response | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.Query | ||
|
||
interface CommunityService { | ||
|
||
@POST(API.SEND_LIKE) | ||
suspend fun likePost(@Body postLikeRequest: PostLikeRequest): Response<PostLikeResponse> | ||
|
||
} | ||
@GET(API.WalkingControl.MY) | ||
suspend fun getUserNickProfile( | ||
@Query("walkieId") id: Long, | ||
): Response<NickProfileResponse> | ||
} |
1 change: 1 addition & 0 deletions
1
data/src/main/java/com/whyranoid/data/datasource/running/RunningService.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
8 changes: 8 additions & 0 deletions
8
data/src/main/java/com/whyranoid/data/model/account/NickProfileResponse.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,8 @@ | ||
package com.whyranoid.data.model.account | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class NickProfileResponse( | ||
@SerializedName("profileImg") val profileImg: String?, | ||
@SerializedName("nickname") val nickname: String?, | ||
) |
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
6 changes: 5 additions & 1 deletion
6
domain/src/main/java/com/whyranoid/domain/usecase/GetUserDetailUseCase.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,15 +1,19 @@ | ||
package com.whyranoid.domain.usecase | ||
|
||
import com.whyranoid.domain.model.user.UserDetail | ||
import com.whyranoid.domain.repository.FollowRepository | ||
import com.whyranoid.domain.repository.UserRepository | ||
|
||
class GetUserDetailUseCase( | ||
private val userRepository: UserRepository, | ||
private val followRepository: FollowRepository, | ||
) { | ||
suspend operator fun invoke(uid: Long): Result<UserDetail> { | ||
return kotlin.runCatching { | ||
val user = userRepository.getUser(uid).getOrThrow() | ||
UserDetail(user, 0, 0, 0, true) | ||
val followingCount = followRepository.getFollowings(user.uid).getOrThrow().size | ||
val followerCount = followRepository.getFollowers(user.uid).getOrThrow().size | ||
UserDetail(user, 0, followerCount, followingCount, true) | ||
} | ||
} | ||
} |
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
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.