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

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.PsychomatrixBase.di 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 { interface UseCasesDI : EntitiesDI {
val calculatePsychomatrixByDate: CalculatePsychomatrixByDate val calculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase
} }

View File

@ -11,7 +11,7 @@ abstract class PresentationLayerDIImpl(
override val datePickerPresenter: DatePickerPresenter by lazy { override val datePickerPresenter: DatePickerPresenter by lazy {
DatePickerPresenterImpl( 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.EntitiesDI
import com.github.insanusmokrassar.PsychomatrixBase.di.UseCasesDI import com.github.insanusmokrassar.PsychomatrixBase.di.UseCasesDI
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDate import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDateUseCase
import com.github.insanusmokrassar.PsychomatrixBase.domain.interactors.CalculatePsychomatrixByDateInteractor import com.github.insanusmokrassar.PsychomatrixBase.domain.interactors.CalculatePsychomatrixByDateUseCaseInteractor
open class UseCasesDIImpl( open class UseCasesDIImpl(
entitiesDI: EntitiesDI entitiesDI: EntitiesDI
) : UseCasesDI, EntitiesDI by entitiesDI { ) : UseCasesDI, EntitiesDI by entitiesDI {
override val calculatePsychomatrixByDate: CalculatePsychomatrixByDate by lazy { val calculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase by lazy {
CalculatePsychomatrixByDateInteractor() CalculatePsychomatrixByDateUseCaseInteractor()
} }
} }

View File

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