mirror of
https://github.com/InsanusMokrassar/PsychomatrixBase.git
synced 2024-11-24 19:18:53 +00:00
rename CalculatePsychomatrixByDate -> CalculatePsychomatrixByDateUseCase
This commit is contained in:
parent
a3f22be582
commit
26a575b614
@ -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)
|
||||||
|
@ -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
|
||||||
}
|
}
|
@ -11,7 +11,7 @@ abstract class PresentationLayerDIImpl(
|
|||||||
|
|
||||||
override val datePickerPresenter: DatePickerPresenter by lazy {
|
override val datePickerPresenter: DatePickerPresenter by lazy {
|
||||||
DatePickerPresenterImpl(
|
DatePickerPresenterImpl(
|
||||||
calculatePsychomatrixByDate
|
calculatePsychomatrixByDateUseCase
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user