From 458b9890dbd196b489aa8773263af726814b150f Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Thu, 11 Jan 2024 23:17:09 +0900 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20#86=20:=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20=EC=82=AD=EC=A0=9C=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/repository/management/ManagementRepository.kt | 2 ++ .../data/repository/management/ManagementRepositoryImpl.kt | 3 +++ .../core/network/source/management/ManagementDataSource.kt | 2 ++ .../network/source/management/ManagementDataSourceImpl.kt | 7 +++++++ 4 files changed, 14 insertions(+) diff --git a/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepository.kt b/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepository.kt index d4c5b1692..7d7cec07b 100644 --- a/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepository.kt +++ b/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepository.kt @@ -6,4 +6,6 @@ interface ManagementRepository { suspend fun postManager(userId: String): Result suspend fun getManagementCode(code: String): Result + + suspend fun deleteManager(userId: String): Result } diff --git a/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepositoryImpl.kt b/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepositoryImpl.kt index f9f782dd6..eb7d4b328 100644 --- a/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepositoryImpl.kt +++ b/core/data/src/main/java/com/wap/wapp/core/data/repository/management/ManagementRepositoryImpl.kt @@ -14,4 +14,7 @@ class ManagementRepositoryImpl @Inject constructor( override suspend fun getManagementCode(code: String): Result = managementDataSource.getManagementCode(code) + + override suspend fun deleteManager(userId: String): Result = + managementDataSource.deleteManager(userId) } diff --git a/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSource.kt b/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSource.kt index c8d3c5285..210825677 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSource.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSource.kt @@ -6,4 +6,6 @@ interface ManagementDataSource { suspend fun postManager(userId: String): Result suspend fun getManagementCode(code: String): Result + + suspend fun deleteManager(userId: String): Result } diff --git a/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSourceImpl.kt b/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSourceImpl.kt index a36389c77..9437382d3 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSourceImpl.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/source/management/ManagementDataSourceImpl.kt @@ -37,4 +37,11 @@ class ManagementDataSourceImpl @Inject constructor( result.isEmpty.not() } + + override suspend fun deleteManager(userId: String): Result = runCatching { + firebaseFirestore.collection(MANAGER_COLLECTION) + .document(userId) + .delete() + .await() + } }