diff --git a/app/src/main/java/com/sopt/umbba_android/data/datasource/OnboardingRemoteDataSource.kt b/app/src/main/java/com/sopt/umbba_android/data/datasource/OnboardingRemoteDataSource.kt index 32679ffe..a3265750 100644 --- a/app/src/main/java/com/sopt/umbba_android/data/datasource/OnboardingRemoteDataSource.kt +++ b/app/src/main/java/com/sopt/umbba_android/data/datasource/OnboardingRemoteDataSource.kt @@ -2,10 +2,20 @@ package com.sopt.umbba_android.data.datasource import com.sopt.umbba_android.data.model.ServicePool import com.sopt.umbba_android.data.model.request.InviteCodeRequestDto +import com.sopt.umbba_android.data.model.request.ReceiveInfoRequestDto +import com.sopt.umbba_android.data.model.request.SendInfoRequestDto import com.sopt.umbba_android.data.model.response.InviteCodeResponseDto +import com.sopt.umbba_android.data.model.response.ReceiveInfoResponseDto +import com.sopt.umbba_android.data.model.response.SendInfoResponseDto class OnboardingRemoteDataSource { private val onboardingService = ServicePool.onboardingService suspend fun setFamily(onboardingRequestDto: InviteCodeRequestDto) : InviteCodeResponseDto = onboardingService.setFamily(onboardingRequestDto) + + suspend fun setSendInfo(sendInfoRequestDto: SendInfoRequestDto) : SendInfoResponseDto = + onboardingService.setSendInfo(sendInfoRequestDto) + + suspend fun setReceiveInfo(receiveInfoRequestDto: ReceiveInfoRequestDto) : ReceiveInfoResponseDto = + onboardingService.setReceiveInfo(receiveInfoRequestDto) } \ No newline at end of file diff --git a/app/src/main/java/com/sopt/umbba_android/data/repository/OnboardingRepositoryImpl.kt b/app/src/main/java/com/sopt/umbba_android/data/repository/OnboardingRepositoryImpl.kt index 76b0240b..bf2a6eb6 100644 --- a/app/src/main/java/com/sopt/umbba_android/data/repository/OnboardingRepositoryImpl.kt +++ b/app/src/main/java/com/sopt/umbba_android/data/repository/OnboardingRepositoryImpl.kt @@ -3,7 +3,11 @@ package com.sopt.umbba_android.data.repository import android.util.Log import com.sopt.umbba_android.data.datasource.OnboardingRemoteDataSource import com.sopt.umbba_android.data.model.request.InviteCodeRequestDto +import com.sopt.umbba_android.data.model.request.ReceiveInfoRequestDto +import com.sopt.umbba_android.data.model.request.SendInfoRequestDto import com.sopt.umbba_android.data.model.response.InviteCodeResponseDto +import com.sopt.umbba_android.data.model.response.ReceiveInfoResponseDto +import com.sopt.umbba_android.data.model.response.SendInfoResponseDto import com.sopt.umbba_android.domain.repository.OnboardingRepository class OnboardingRepositoryImpl( @@ -13,8 +17,26 @@ class OnboardingRepositoryImpl( runCatching { onboardingRemoteDataSource.setFamily(inviteCodeRequestDto) }.onSuccess { - Log.e("yeonjin", "onboarding Impl 성공") + Log.e("yeonjin", "onboarding setFamily Impl 성공") }.onFailure { - Log.e("yeonjin", "onboarding Impl 실패") + Log.e("yeonjin", "onboarding setFamily Impl 실패") + } + + override suspend fun setSendInfo(sendInfoRequestDto: SendInfoRequestDto): Result = + runCatching { + onboardingRemoteDataSource.setSendInfo(sendInfoRequestDto) + }.onSuccess { + Log.e("yeonjin", "onboarding setSendInfo Impl 성공") + }.onFailure { + Log.e("yeonjin", "onboarding setSendInfo Impl 성공") + } + + override suspend fun setReceiveInfo(receiveInfoRequestDto: ReceiveInfoRequestDto): Result = + runCatching { + onboardingRemoteDataSource.setReceiveInfo(receiveInfoRequestDto) + }.onSuccess { + Log.e("yeonjin", "onboarding setReceiveInfo Impl 성공") + }.onFailure { + Log.e("yeonjin", "onboarding setReceiveInfo Impl 성공") } } \ No newline at end of file diff --git a/app/src/main/java/com/sopt/umbba_android/domain/repository/OnboardingRepository.kt b/app/src/main/java/com/sopt/umbba_android/domain/repository/OnboardingRepository.kt index a58451b5..6e94aa9e 100644 --- a/app/src/main/java/com/sopt/umbba_android/domain/repository/OnboardingRepository.kt +++ b/app/src/main/java/com/sopt/umbba_android/domain/repository/OnboardingRepository.kt @@ -1,8 +1,16 @@ package com.sopt.umbba_android.domain.repository import com.sopt.umbba_android.data.model.request.InviteCodeRequestDto +import com.sopt.umbba_android.data.model.request.ReceiveInfoRequestDto +import com.sopt.umbba_android.data.model.request.SendInfoRequestDto import com.sopt.umbba_android.data.model.response.InviteCodeResponseDto +import com.sopt.umbba_android.data.model.response.ReceiveInfoResponseDto +import com.sopt.umbba_android.data.model.response.SendInfoResponseDto interface OnboardingRepository { suspend fun setFamily(inviteCodeRequestDto: InviteCodeRequestDto): Result + + suspend fun setSendInfo(sendInfoRequestDto: SendInfoRequestDto): Result + + suspend fun setReceiveInfo(receiveInfoRequestDto: ReceiveInfoRequestDto): Result } \ No newline at end of file