mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Add packages and classes for Api, Repository and Database. Add Transmitter entity data class.
This commit is contained in:
1 parent
7d4b325325
commit
1995fbddde
6 files changed
+51
No files matched your search
@@ -0,0 +1,10 @@
|
||||
package com.rtbishop.lookingsat.api
|
||||
|
||||
import com.rtbishop.lookingsat.repo.Transmitter
|
||||
import retrofit2.http.GET
|
||||
|
||||
interface TransmitterApi {
|
||||
|
||||
@GET("transmitters/?alive=true")
|
||||
suspend fun getTransmitterList(): List<Transmitter>
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.rtbishop.lookingsat.api
|
||||
|
||||
class TransmitterService
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.rtbishop.lookingsat.db
|
||||
|
||||
import androidx.room.Dao
|
||||
|
||||
@Dao
|
||||
interface TransmitterDao
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.rtbishop.lookingsat.db
|
||||
|
||||
import androidx.room.Database
|
||||
import androidx.room.RoomDatabase
|
||||
import com.rtbishop.lookingsat.repo.Transmitter
|
||||
|
||||
@Database(entities = [Transmitter::class], version = 1, exportSchema = false)
|
||||
abstract class TransmitterDatabase : RoomDatabase() {
|
||||
|
||||
abstract fun transDao(): TransmitterDao
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.rtbishop.lookingsat.repo
|
||||
|
||||
class Repository
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.rtbishop.lookingsat.repo
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Entity(tableName = "transmitters")
|
||||
data class Transmitter(
|
||||
@PrimaryKey @SerializedName("uuid") val uuid: String,
|
||||
@SerializedName("description") val description: String,
|
||||
@SerializedName("uplink_low") val uplinkLow: Long?,
|
||||
@SerializedName("uplink_high") val uplinkHigh: Long?,
|
||||
@SerializedName("downlink_low") val downlinkLow: Long?,
|
||||
@SerializedName("downlink_high") val downlinkHigh: Long?,
|
||||
@SerializedName("mode") val mode: String,
|
||||
@SerializedName("invert") val isInverted: Boolean,
|
||||
@SerializedName("norad_cat_id") val noradCatId: Int
|
||||
)
|
||||
Reference in new issue
Block a user