mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Added SatelliteRepo basic interactors
This commit is contained in:
1 parent
d0569f4645
commit
865ecfb5bf
6 files changed
+66
No files matched your search
@@ -0,0 +1,12 @@
|
||||
package com.rtbishop.look4sat.interactors
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatelliteRepo
|
||||
import com.rtbishop.look4sat.domain.model.SatItem
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
class GetSatItems(private val satelliteRepo: SatelliteRepo) {
|
||||
|
||||
operator fun invoke(): Flow<List<SatItem>> {
|
||||
return satelliteRepo.getSatItems()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.rtbishop.look4sat.interactors
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatelliteRepo
|
||||
import com.rtbishop.look4sat.predict4kotlin.Satellite
|
||||
|
||||
class GetSelectedSatellites(private val satelliteRepo: SatelliteRepo) {
|
||||
|
||||
suspend operator fun invoke(): List<Satellite> {
|
||||
return satelliteRepo.getSelectedSatellites()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.rtbishop.look4sat.interactors
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatelliteRepo
|
||||
import com.rtbishop.look4sat.domain.model.Transmitter
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
class GetTransmittersForSat(private val satelliteRepo: SatelliteRepo) {
|
||||
|
||||
operator fun invoke(catNum: Int): Flow<List<Transmitter>> {
|
||||
return satelliteRepo.getTransmittersForSat(catNum)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.rtbishop.look4sat.interactors
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatelliteRepo
|
||||
import java.io.InputStream
|
||||
|
||||
class ImportDataFromFile(private val satelliteRepo: SatelliteRepo) {
|
||||
|
||||
suspend operator fun invoke(stream: InputStream) {
|
||||
satelliteRepo.importDataFromFile(stream)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.rtbishop.look4sat.interactors
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatelliteRepo
|
||||
|
||||
class ImportDataFromWeb(private val satelliteRepo: SatelliteRepo) {
|
||||
|
||||
suspend operator fun invoke(sources: List<String>) {
|
||||
satelliteRepo.importDataFromWeb(sources)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.rtbishop.look4sat.interactors
|
||||
|
||||
import com.rtbishop.look4sat.domain.SatelliteRepo
|
||||
|
||||
class UpdateEntriesSelection(private val satelliteRepo: SatelliteRepo) {
|
||||
|
||||
suspend operator fun invoke(catNums: List<Int>, isSelected: Boolean) {
|
||||
satelliteRepo.updateEntriesSelection(catNums, isSelected)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user