From d61c6a92da9320c21b4dd4a8af78781111b09029 Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Wed, 30 Jul 2025 17:20:07 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Feat:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20API=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - API endpoint 수정 --- .../bitnagil/data/user/service/UserService.kt | 2 +- .../presentation/mypage/MyPageViewModel.kt | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.kt b/data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.kt index 76b4823e..d2fc21db 100644 --- a/data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.kt +++ b/data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.kt @@ -5,6 +5,6 @@ import com.threegap.bitnagil.network.model.BaseResponse import retrofit2.http.GET interface UserService { - @GET("/api/v1/users/nickname") + @GET("/api/v1/users/infos") suspend fun fetchUserProfile(): BaseResponse } diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageViewModel.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageViewModel.kt index 9b63e38c..cd57e4c1 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageViewModel.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageViewModel.kt @@ -2,6 +2,7 @@ package com.threegap.bitnagil.presentation.mypage import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewModelScope +import com.threegap.bitnagil.domain.user.usecase.FetchUserProfileUseCase import com.threegap.bitnagil.presentation.common.mviviewmodel.MviViewModel import com.threegap.bitnagil.presentation.mypage.model.MyPageIntent import com.threegap.bitnagil.presentation.mypage.model.MyPageSideEffect @@ -14,6 +15,7 @@ import javax.inject.Inject @HiltViewModel class MyPageViewModel @Inject constructor( savedStateHandle: SavedStateHandle, + private val fetchUserProfileUseCase: FetchUserProfileUseCase, ) : MviViewModel( MyPageState.Init, savedStateHandle, @@ -24,7 +26,18 @@ class MyPageViewModel @Inject constructor( private fun loadMyPageInfo() { viewModelScope.launch { - sendIntent(MyPageIntent.LoadMyPageSuccess(name = "이름", profileUrl = "profileUrl")) + fetchUserProfileUseCase().fold( + onSuccess = { + sendIntent( + MyPageIntent.LoadMyPageSuccess( + name = it.nickname, + profileUrl = "profileUrl", + ), + ) + }, + onFailure = { + }, + ) } } From 962248696a472c42ef428d542aad1b603c1a71f0 Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Wed, 30 Jul 2025 17:22:54 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Fix:=20=EA=B0=90=EC=A0=95=EA=B5=AC=EC=8A=AC?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=20api=20Query=EC=97=90=EC=84=9C=20Path?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../threegap/bitnagil/data/emotion/service/EmotionService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt b/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt index 82eb3dcb..b090d74d 100644 --- a/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt +++ b/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt @@ -8,6 +8,7 @@ import com.threegap.bitnagil.network.model.BaseResponse import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST +import retrofit2.http.Path import retrofit2.http.Query interface EmotionService { @@ -19,8 +20,8 @@ interface EmotionService { @Body request: RegisterEmotionRequest, ): BaseResponse - @GET("/api/v1/emotion-marbles/me") + @GET("/api/v1/emotion-marbles/{searchDate}") suspend fun getMyEmotionMarble( - @Query("searchDate") date: String, + @Path("searchDate") date: String, ): BaseResponse } From d9fbc5f50a30381b58c8484603a2d58a1b631547 Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Wed, 30 Jul 2025 17:26:55 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Chore:=20ktlintFormat=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/threegap/bitnagil/data/emotion/service/EmotionService.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt b/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt index b090d74d..728c8d44 100644 --- a/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt +++ b/data/src/main/java/com/threegap/bitnagil/data/emotion/service/EmotionService.kt @@ -9,7 +9,6 @@ import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST import retrofit2.http.Path -import retrofit2.http.Query interface EmotionService { @GET("/api/v1/emotion-marbles")