refactor(server): split gtfs into its own module
This commit is contained in:
parent
aad5ae4024
commit
0181497420
18 changed files with 241 additions and 132 deletions
|
|
@ -13,4 +13,8 @@ enum class RouteType(val value: Int) {
|
|||
SkyBus(11),
|
||||
Interstate(10),
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun from(value: Int) = RouteType.entries.first { it.value == value }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import moe.lava.banksia.model.RouteType
|
|||
|
||||
object RouteTypeConverter {
|
||||
@TypeConverter
|
||||
fun from(value: Int) = RouteType.entries.first { it.value == value }
|
||||
fun from(value: Int) = RouteType.from(value)
|
||||
|
||||
@TypeConverter
|
||||
fun to(routeType: RouteType) = routeType.value
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package moe.lava.banksia.room.dao
|
|||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy.Companion.REPLACE
|
||||
import androidx.room.Query
|
||||
import moe.lava.banksia.room.entity.ShapeEntity
|
||||
|
||||
|
|
@ -14,6 +15,9 @@ interface ShapeDao {
|
|||
@Insert
|
||||
suspend fun insertAll(vararg shapes: ShapeEntity)
|
||||
|
||||
@Insert(onConflict = REPLACE)
|
||||
suspend fun insertOrReplaceAll(vararg shapes: ShapeEntity)
|
||||
|
||||
@Delete
|
||||
suspend fun delete(shape: ShapeEntity)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue