diff --git a/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/HomeTabViewModel.kt b/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/HomeTabViewModel.kt index 3d3b431767..7e67cf64b7 100644 --- a/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/HomeTabViewModel.kt +++ b/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/HomeTabViewModel.kt @@ -3,8 +3,8 @@ package com.afternote.feature.home.presentation import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.UserProfileCacheRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.home.presentation.reporting.HomeFailureStage import com.afternote.feature.home.presentation.reporting.recordHomeFailure import com.afternote.feature.home.presentation.usecase.GetHomeSummaryUseCase diff --git a/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetHomeSummaryUseCase.kt b/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetHomeSummaryUseCase.kt index 0cb8ecbb48..838252c313 100644 --- a/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetHomeSummaryUseCase.kt +++ b/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetHomeSummaryUseCase.kt @@ -1,8 +1,8 @@ package com.afternote.feature.home.presentation.usecase -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.MyProfileRepository import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.home.presentation.usecase.HomeSummary import com.afternote.feature.mindrecord.domain.repository.DailyQuestionRepository import com.afternote.feature.mindrecord.domain.repository.DiaryRepository @@ -20,10 +20,8 @@ import javax.inject.Inject * 프로필/수신자 조회는 필수(실패 시 전체 실패), 일기 카운트·오늘의 질문은 보조(실패 시 * 0/null 폴백)로 처리해 보조 호출 한 건의 실패 때문에 홈 화면 자체가 깨지지 않도록 한다. * - * UseCase는 통상 domain 레이어에 위치하나, 이 조합은 `feature/mindrecord/domain`과 - * `core:common`(runCatchingCancellable)을 함께 끌어와야 해서 domain 패키지에 두면 - * 레이어 가드(LayerDependencyKonsistTest, 비-core:model 코어 금지)에 걸린다. - * 홈 전용 조합 로직이므로 홈 presentation 모듈에 둔다. + * `core:domain`과 `feature/mindrecord/domain`의 계약을 조합하는 홈 전용 로직이므로 + * 홈 presentation 모듈에 둔다. */ class GetHomeSummaryUseCase @Inject diff --git a/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetReceiverHomeSummaryUseCase.kt b/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetReceiverHomeSummaryUseCase.kt index 2b03c53dd7..e3281f6916 100644 --- a/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetReceiverHomeSummaryUseCase.kt +++ b/feature/home/presentation/src/main/kotlin/com/afternote/feature/home/presentation/usecase/GetReceiverHomeSummaryUseCase.kt @@ -1,6 +1,6 @@ package com.afternote.feature.home.presentation.usecase -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.mindrecord.domain.model.ReceiverMindRecords import com.afternote.feature.mindrecord.domain.repository.MindRecordReceiverRepository import com.afternote.feature.receiver.domain.model.AfterNotesListResult diff --git a/feature/mindrecord/data/build.gradle.kts b/feature/mindrecord/data/build.gradle.kts index d5bbed255f..2e25f529ad 100644 --- a/feature/mindrecord/data/build.gradle.kts +++ b/feature/mindrecord/data/build.gradle.kts @@ -12,9 +12,10 @@ android { dependencies { implementation(projects.feature.mindrecord.domain) + implementation(projects.core.common) // 취소를 다시 던지는 runCatchingCancellable — repository 가 CancellationException 을 // Result.failure 로 삼키지 않게 한다 (#670). - implementation(projects.core.common) + implementation(projects.core.domain) implementation(projects.core.network) // 취소 전파 회귀 테스트 — runTest 로 Job 취소 시점을 제어한다 (#670). diff --git a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DailyQuestionRepositoryImpl.kt b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DailyQuestionRepositoryImpl.kt index a1ba966ec7..5c0771775a 100644 --- a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DailyQuestionRepositoryImpl.kt +++ b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DailyQuestionRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.afternote.feature.mindrecord.data.repositoryimpl -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.core.network.model.requireStatus import com.afternote.feature.mindrecord.data.api.DailyQuestionApiService diff --git a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DiaryRepositoryImpl.kt b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DiaryRepositoryImpl.kt index 6718fab826..960489d52c 100644 --- a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DiaryRepositoryImpl.kt +++ b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/DiaryRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.afternote.feature.mindrecord.data.repositoryimpl -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.core.network.model.requireStatus import com.afternote.feature.mindrecord.data.api.DiaryApiService diff --git a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordReceiverRepositoryImpl.kt b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordReceiverRepositoryImpl.kt index 84549cd82d..fd36626714 100644 --- a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordReceiverRepositoryImpl.kt +++ b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordReceiverRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.afternote.feature.mindrecord.data.repositoryimpl -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.ApiException import com.afternote.core.network.model.requireData import com.afternote.feature.mindrecord.data.api.MindRecordReceiverApiService diff --git a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/WeeklyReportRepositoryImpl.kt b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/WeeklyReportRepositoryImpl.kt index 5ef3b61106..bf1af2d6a8 100644 --- a/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/WeeklyReportRepositoryImpl.kt +++ b/feature/mindrecord/data/src/main/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/WeeklyReportRepositoryImpl.kt @@ -1,6 +1,6 @@ package com.afternote.feature.mindrecord.data.repositoryimpl -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.network.model.requireData import com.afternote.feature.mindrecord.data.api.WeeklyReportApiService import com.afternote.feature.mindrecord.data.mapper.toDomain diff --git a/feature/mindrecord/data/src/test/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordCancellationTest.kt b/feature/mindrecord/data/src/test/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordCancellationTest.kt index ff08193d98..239f739064 100644 --- a/feature/mindrecord/data/src/test/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordCancellationTest.kt +++ b/feature/mindrecord/data/src/test/kotlin/com/afternote/feature/mindrecord/data/repositoryimpl/MindRecordCancellationTest.kt @@ -26,7 +26,7 @@ import org.junit.Test * * stdlib `runCatching` 은 `CancellationException` 까지 잡아 정상 반환으로 바꾼다. 그러면 * 이미 취소된 코루틴에서 호출부의 `onFailure` 갈래(오류 상태 갱신·스낵바)가 실행된다. - * `core:common` 의 `runCatchingCancellable` 은 취소만 다시 던지므로 호출 지점에서 그대로 빠져나간다. + * `core:domain` 의 `runCatchingCancellable` 은 취소만 다시 던지므로 호출 지점에서 그대로 빠져나간다. * * 판정 기준은 "반환값이 대입되지 않는 것" 이다 — 취소된 Job 은 어느 쪽이든 `isCancelled` 라 * 그것만으로는 두 동작을 구분할 수 없다. diff --git a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/GetMemorySpaceUseCase.kt b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/GetMemorySpaceUseCase.kt index 413a10ee5b..1f1055dce1 100644 --- a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/GetMemorySpaceUseCase.kt +++ b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/GetMemorySpaceUseCase.kt @@ -1,6 +1,6 @@ package com.afternote.feature.mindrecord.presentation.usecase -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.mindrecord.domain.model.DailyQuestion import com.afternote.feature.mindrecord.domain.model.Diary import com.afternote.feature.mindrecord.domain.model.MindRecordType diff --git a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/LoadMindRecordDraftsUseCase.kt b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/LoadMindRecordDraftsUseCase.kt index 78f38cf33e..be6b2a77e2 100644 --- a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/LoadMindRecordDraftsUseCase.kt +++ b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/LoadMindRecordDraftsUseCase.kt @@ -1,6 +1,6 @@ package com.afternote.feature.mindrecord.presentation.usecase -import com.afternote.core.common.result.runCatchingCancellable +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.mindrecord.domain.model.DailyQuestion import com.afternote.feature.mindrecord.domain.model.Diary import com.afternote.feature.mindrecord.domain.repository.DailyQuestionRepository diff --git a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/ObserveWeeklyReportUseCase.kt b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/ObserveWeeklyReportUseCase.kt index bd15ba00ec..e8f8777121 100644 --- a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/ObserveWeeklyReportUseCase.kt +++ b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/usecase/ObserveWeeklyReportUseCase.kt @@ -1,7 +1,7 @@ package com.afternote.feature.mindrecord.presentation.usecase -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.MyProfileRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.feature.mindrecord.domain.model.EmotionAnalysisStatus import com.afternote.feature.mindrecord.domain.model.WeeklyReport import com.afternote.feature.mindrecord.domain.repository.WeeklyReportRepository diff --git a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/viewmodel/DiaryWriteViewModel.kt b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/viewmodel/DiaryWriteViewModel.kt index 1a8d0167b2..d8d7526c80 100644 --- a/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/viewmodel/DiaryWriteViewModel.kt +++ b/feature/mindrecord/presentation/src/main/kotlin/com/afternote/feature/mindrecord/presentation/viewmodel/DiaryWriteViewModel.kt @@ -6,9 +6,9 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import androidx.navigation.toRoute import com.afternote.core.common.reporting.ErrorReporter -import com.afternote.core.common.result.runCatchingCancellable import com.afternote.core.domain.repository.PhotoUploadRepository import com.afternote.core.domain.repository.UserReceiverRepository +import com.afternote.core.domain.result.runCatchingCancellable import com.afternote.core.ui.UiText import com.afternote.feature.mindrecord.domain.model.DiaryCreatePayload import com.afternote.feature.mindrecord.domain.model.DiaryUpdatePayload