From 094db33a95464ca1175ed36cd3c54b08016f03d2 Mon Sep 17 00:00:00 2001 From: hyeumm <20221159@sungshin.ac.kr> Date: Fri, 6 Dec 2024 22:44:31 +0900 Subject: [PATCH] feature #13: SignInRepositoryImpl --- .../repositoryimpl/SignInRepositoryImpl.kt | 17 ++++++++++++ .../repositoryimpl/WavveRepositoryImpl.kt | 27 ------------------- 2 files changed, 17 insertions(+), 27 deletions(-) create mode 100644 app/src/main/java/org/sopt/and/data/repositoryimpl/SignInRepositoryImpl.kt delete mode 100644 app/src/main/java/org/sopt/and/data/repositoryimpl/WavveRepositoryImpl.kt diff --git a/app/src/main/java/org/sopt/and/data/repositoryimpl/SignInRepositoryImpl.kt b/app/src/main/java/org/sopt/and/data/repositoryimpl/SignInRepositoryImpl.kt new file mode 100644 index 0000000..4a5ed3f --- /dev/null +++ b/app/src/main/java/org/sopt/and/data/repositoryimpl/SignInRepositoryImpl.kt @@ -0,0 +1,17 @@ +package org.sopt.and.data.repositoryimpl + +import org.sopt.and.data.datasource.AuthDataSource +import org.sopt.and.data.dto.request.toDto +import org.sopt.and.domain.entity.request.RequestSignInEntity +import org.sopt.and.domain.entity.response.ResponseSignInEntity +import org.sopt.and.domain.repository.SignInRepository +import javax.inject.Inject + +class SignInRepositoryImpl @Inject constructor( + private val authDataSource: AuthDataSource +) : SignInRepository { + override suspend fun signIn(body: RequestSignInEntity): Result = + runCatching { + authDataSource.postSignIn(body.toDto()).result.toEntity() + } +} diff --git a/app/src/main/java/org/sopt/and/data/repositoryimpl/WavveRepositoryImpl.kt b/app/src/main/java/org/sopt/and/data/repositoryimpl/WavveRepositoryImpl.kt deleted file mode 100644 index 90169c6..0000000 --- a/app/src/main/java/org/sopt/and/data/repositoryimpl/WavveRepositoryImpl.kt +++ /dev/null @@ -1,27 +0,0 @@ -package org.sopt.and.data.repositoryimpl - -import org.sopt.and.data.datasource.WavveDataSource -import org.sopt.and.data.dto.request.toDto -import org.sopt.and.domain.entity.request.RequestSignInEntity -import org.sopt.and.domain.entity.request.RequestSignUpEntity -import org.sopt.and.domain.entity.response.ResponseHobbyEntity -import org.sopt.and.domain.entity.response.ResponseSignInEntity -import org.sopt.and.domain.entity.response.ResponseSignUpEntity -import org.sopt.and.domain.repository.WavveRepository -import javax.inject.Inject - -class WavveRepositoryImpl @Inject constructor( - private val wavveDataSource: WavveDataSource -) : WavveRepository { - override suspend fun signUp(body: RequestSignUpEntity): Result = runCatching { - wavveDataSource.postSignUp(body.toDto()).result.toEntity() - } - - override suspend fun signIn(body: RequestSignInEntity): Result = runCatching { - wavveDataSource.postSignIn(body.toDto()).result.toEntity() - } - - override suspend fun getHobby(): Result = runCatching { - wavveDataSource.getUserHobby().result.toEntity() - } -}