rename CalculatePsychomatrixByDate -> CalculatePsychomatrixByDateUseCase

This commit is contained in:
InsanusMokrassar 2018-09-05 20:04:46 +08:00
parent a3f22be582
commit 26a575b614
5 changed files with 13 additions and 13 deletions

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.PsychomatrixBase.data.repository.realisations
import com.github.insanusmokrassar.PsychomatrixBase.data.repository.HistoryDatesRepository
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDate
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDateUseCase
import com.github.insanusmokrassar.PsychomatrixBase.utils.extensions.SUBSCRIPTIONS_EXTRA_SMALL
import com.github.insanusmokrassar.PsychomatrixBase.utils.extensions.subscribe
import kotlinx.coroutines.experimental.*
@ -10,14 +10,14 @@ import kotlinx.coroutines.experimental.channels.ReceiveChannel
import org.joda.time.DateTime
abstract class HistoryDatesRepositoryImpl(
calculatePsychomatrixByDate: CalculatePsychomatrixByDate
calculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase
) : HistoryDatesRepository {
private val dateAddedBroadcast = BroadcastChannel<DateTime>(SUBSCRIPTIONS_EXTRA_SMALL)
private val dateRemovedBroadcast = BroadcastChannel<DateTime>(SUBSCRIPTIONS_EXTRA_SMALL)
init {
launch {
calculatePsychomatrixByDate.openPsychomatrixCreatedSubscription().subscribe {
calculatePsychomatrixByDateUseCase.openPsychomatrixCreatedSubscription().subscribe {
it.date.also {
date ->
onDateCalculated(date)

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.PsychomatrixBase.di
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDate
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDateUseCase
interface UseCasesDI : EntitiesDI {
val calculatePsychomatrixByDate: CalculatePsychomatrixByDate
val calculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase
}

View File

@ -11,7 +11,7 @@ abstract class PresentationLayerDIImpl(
override val datePickerPresenter: DatePickerPresenter by lazy {
DatePickerPresenterImpl(
calculatePsychomatrixByDate
calculatePsychomatrixByDateUseCase
)
}

View File

@ -2,15 +2,15 @@ package com.github.insanusmokrassar.PsychomatrixBase.di.realisations
import com.github.insanusmokrassar.PsychomatrixBase.di.EntitiesDI
import com.github.insanusmokrassar.PsychomatrixBase.di.UseCasesDI
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDate
import com.github.insanusmokrassar.PsychomatrixBase.domain.interactors.CalculatePsychomatrixByDateInteractor
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDateUseCase
import com.github.insanusmokrassar.PsychomatrixBase.domain.interactors.CalculatePsychomatrixByDateUseCaseInteractor
open class UseCasesDIImpl(
entitiesDI: EntitiesDI
) : UseCasesDI, EntitiesDI by entitiesDI {
override val calculatePsychomatrixByDate: CalculatePsychomatrixByDate by lazy {
CalculatePsychomatrixByDateInteractor()
val calculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase by lazy {
CalculatePsychomatrixByDateUseCaseInteractor()
}
}

View File

@ -1,6 +1,6 @@
package com.github.insanusmokrassar.PsychomatrixBase.presentation.presenters.DefaultRealisations
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDate
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDateUseCase
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.Psychomatrix
import com.github.insanusmokrassar.PsychomatrixBase.presentation.presenters.DatePickerPresenter
import com.github.insanusmokrassar.PsychomatrixBase.utils.extensions.SUBSCRIPTIONS_MEDIUM
@ -10,7 +10,7 @@ import kotlinx.coroutines.experimental.launch
import org.joda.time.DateTime
class DatePickerPresenterImpl(
private val CalculatePsychomatrixByDate: CalculatePsychomatrixByDate
private val CalculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase
) : DatePickerPresenter {
private val psychomatrixCreateBroadcastChannel = BroadcastChannel<Psychomatrix>(SUBSCRIPTIONS_MEDIUM)
@ -24,7 +24,7 @@ class DatePickerPresenterImpl(
override fun userPickDate(date: DateTime) {
launch {
CalculatePsychomatrixByDate.calculate(date).await().also {
CalculatePsychomatrixByDateUseCase.calculate(date).await().also {
psychomatrixCreateBroadcastChannel.send(it)
}
}