-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99046a7
commit c33938b
Showing
9 changed files
with
111 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
data/models/src/commonMain/kotlin/com/kafka/data/model/AppConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.kafka.data.model | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class AppConfig( | ||
@SerialName("app_update") val appUpdate: AppUpdateConfig, | ||
) | ||
|
||
@Serializable | ||
data class AppUpdateConfig( | ||
@SerialName("soft_update_version") val softUpdateVersion: Int, | ||
@SerialName("force_update_version") val forceUpdateVersion: Int, | ||
@SerialName("blocked_update_version") val blockedAppVersions: List<Int>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
domain/src/main/java/com/kafka/domain/observers/ObserveAppUpdateConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.kafka.domain.observers | ||
|
||
import com.kafka.base.domain.SubjectInteractor | ||
import com.kafka.data.feature.firestore.FirestoreGraph | ||
import com.kafka.data.model.AppUpdateConfig | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.map | ||
import javax.inject.Inject | ||
|
||
class ObserveAppUpdateConfig @Inject constructor( | ||
private val firestoreGraph: FirestoreGraph | ||
) : SubjectInteractor<Unit, AppUpdateConfig>() { | ||
override fun createObservable(params: Unit): Flow<AppUpdateConfig> { | ||
return firestoreGraph.appUpdateConfig.snapshots | ||
.map { it.data() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters