mirror of
https://github.com/InsanusMokrassar/PsychomatrixBase.git
synced 2024-11-24 11:08: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
|
||||
|
||||
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)
|
||||
|
@ -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
|
||||
}
|
@ -11,7 +11,7 @@ abstract class PresentationLayerDIImpl(
|
||||
|
||||
override val datePickerPresenter: DatePickerPresenter by lazy {
|
||||
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.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()
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user