Skip to content

Commit

Permalink
feat: 최초 실행 판별 로직 추가 #57
Browse files Browse the repository at this point in the history
  • Loading branch information
easyhz committed Aug 12, 2024
1 parent d15532b commit 58dd1bb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ package com.easyhz.noffice.data.member.repository.user

interface UserRepository {
suspend fun getIsFirstRun(): Result<Boolean>
suspend fun setIsFirstRun(newValue: Boolean): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ class UserRepositoryImpl @Inject constructor(
override suspend fun getIsFirstRun(): Result<Boolean> {
return userLocalDataSource.getFirstRun()
}

override suspend fun setIsFirstRun(newValue: Boolean): Result<Unit> = runCatching {
return@runCatching userLocalDataSource.updateFirstRun(newValue)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.easyhz.noffice.domain.home.usecase.onboarding

import com.easyhz.noffice.core.common.base.BaseUseCase
import com.easyhz.noffice.data.member.repository.user.UserRepository
import javax.inject.Inject

class SetIsFirstRunUseCase @Inject constructor(
private val userRepository: UserRepository
): BaseUseCase<Boolean, Unit>() {
override suspend fun invoke(param: Boolean): Result<Unit> {
return userRepository.setIsFirstRun(param)
}
}

0 comments on commit 58dd1bb

Please sign in to comment.