Skip to content

Commit

Permalink
♻️ domain モジュールに explicitApi を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsutakein committed Nov 23, 2023
1 parent e1c9e75 commit bb66ea5
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 56 deletions.
2 changes: 2 additions & 0 deletions core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ plugins {
android.namespace = "club.nito.core.domain"

kotlin {
explicitApi()

sourceSets {
commonMain {
dependencies {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import kotlinx.coroutines.flow.flow
/**
* スケジュール一覧を取得するユースケース
*/
sealed interface GetParticipantScheduleListUseCase {
operator fun invoke(): Flow<FetchMultipleContentResult<ParticipantSchedule>>
public sealed interface GetParticipantScheduleListUseCase {
public operator fun invoke(): Flow<FetchMultipleContentResult<ParticipantSchedule>>
}

class GetParticipantScheduleListExecutor(
public class GetParticipantScheduleListExecutor(
private val scheduleRepository: ScheduleRepository,
private val participantRepository: ParticipantRepository,
private val userRepository: UserRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import kotlinx.datetime.Clock
/**
* 直近のスケジュールを取得するユースケース
*/
sealed interface GetRecentScheduleUseCase {
operator fun invoke(): Flow<FetchSingleContentResult<ParticipantSchedule>>
public sealed interface GetRecentScheduleUseCase {
public operator fun invoke(): Flow<FetchSingleContentResult<ParticipantSchedule>>
}

class GetRecentScheduleExecutor(
public class GetRecentScheduleExecutor(
private val scheduleRepository: ScheduleRepository,
private val participantRepository: ParticipantRepository,
private val userRepository: UserRepository,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import club.nito.core.model.runExecuting
/**
* 直近のスケジュールを取得するユースケース
*/
sealed interface ModifyPasswordUseCase {
suspend operator fun invoke(password: String): ExecuteResult<UserInfo>
public sealed interface ModifyPasswordUseCase {
public suspend operator fun invoke(password: String): ExecuteResult<UserInfo>
}

class ModifyPasswordExecutor(
public class ModifyPasswordExecutor(
private val authRepository: AuthRepository,
) : ModifyPasswordUseCase {
override suspend fun invoke(password: String) = runExecuting {
override suspend fun invoke(password: String): ExecuteResult<UserInfo> = runExecuting {
authRepository.modifyAuthUser(
email = null,
password = password,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import kotlinx.coroutines.flow.Flow
/**
* 認証状態を購読するユースケース
*/
sealed interface ObserveAuthStatusUseCase {
operator fun invoke(): Flow<FetchSingleResult<AuthStatus>>
public sealed interface ObserveAuthStatusUseCase {
public operator fun invoke(): Flow<FetchSingleResult<AuthStatus>>
}

class ObserveAuthStatusExecutor(
public class ObserveAuthStatusExecutor(
private val authRepository: AuthRepository,
) : ObserveAuthStatusUseCase {
override fun invoke(): Flow<FetchSingleResult<AuthStatus>> = authRepository.authStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import club.nito.core.model.ExecuteResult
/**
* 参加表明するユースケース
*/
sealed interface ParticipateUseCase {
suspend operator fun invoke(scheduleId: String, comment: String): ExecuteResult<Unit>
public sealed interface ParticipateUseCase {
public suspend operator fun invoke(scheduleId: String, comment: String): ExecuteResult<Unit>
}

class ParticipateExecutor(
public class ParticipateExecutor(
private val participantRepository: ParticipantRepository,
) : ParticipateUseCase {
override suspend fun invoke(scheduleId: String, comment: String): ExecuteResult<Unit> {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import club.nito.core.model.runExecuting
/**
* 直近のスケジュールを取得するユースケース
*/
sealed interface SignInUseCase {
suspend operator fun invoke(email: String, password: String): ExecuteResult<Unit>
public sealed interface SignInUseCase {
public suspend operator fun invoke(email: String, password: String): ExecuteResult<Unit>
}

class SignInExecutor(
public class SignInExecutor(
private val authRepository: AuthRepository,
) : SignInUseCase {
override suspend fun invoke(email: String, password: String): ExecuteResult<Unit> = runExecuting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import club.nito.core.model.runExecuting
/**
* 直近のスケジュールを取得するユースケース
*/
sealed interface SignOutUseCase {
suspend operator fun invoke(): ExecuteResult<Unit>
public sealed interface SignOutUseCase {
public suspend operator fun invoke(): ExecuteResult<Unit>
}

class SignOutExecutor(
public class SignOutExecutor(
private val authRepository: AuthRepository,
) : SignOutUseCase {
override suspend fun invoke(): ExecuteResult<Unit> = runExecuting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.koin.core.module.dsl.singleOf
import org.koin.dsl.bind
import org.koin.dsl.module

val useCaseModule: Module = module {
public val useCaseModule: Module = module {
singleOf(::ObserveAuthStatusExecutor) bind ObserveAuthStatusUseCase::class
singleOf(::SignInExecutor) bind SignInUseCase::class
singleOf(::ModifyPasswordExecutor) bind ModifyPasswordUseCase::class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package club.nito.core.domain.model
import club.nito.core.model.UserProfile
import kotlinx.datetime.Instant

data class ParticipantSchedule(
public data class ParticipantSchedule(
val id: String,
val scheduledAt: Instant,
val metAt: Instant,
Expand Down

This file was deleted.

0 comments on commit bb66ea5

Please sign in to comment.