Skip to content

Commit

Permalink
feat: create dao for database
Browse files Browse the repository at this point in the history
  • Loading branch information
aleixo-dev committed Apr 27, 2024
1 parent 164ef0d commit 83df528
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/src/main/java/com/nicolas/freegames/data/local/ModelGameDao.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.nicolas.freegames.data.local

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface ModelGameDao {

@Query("SELECT * FROM modelgameentity")
fun getAll(): List<ModelGameEntity>

@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertAllData(modelGame: ModelGameEntity)

}
6 changes: 6 additions & 0 deletions app/src/main/java/com/nicolas/freegames/navigation/Screen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ enum class Screen(route: String) {
ONBOARDING(route = "onBoarding"),
HOME(route = "home"),
DETAILS(route = "details"),
}

sealed class NavigationRoute(val path : String) {
object OnBoarding : NavigationRoute(path ="onBoarding")
object Home : NavigationRoute(path = "home")
object Details : NavigationRoute("details")
}

0 comments on commit 83df528

Please sign in to comment.