mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 21:27:01 +05:30
model: annotate for Room compatibility
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
4a363200a0
commit
54a0cd2b50
2 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@ plugins {
|
|||
|
||||
dependencies {
|
||||
def moshi_version = "1.9.3"
|
||||
api "androidx.room:room-runtime:$room_version"
|
||||
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
|
||||
implementation "com.squareup.moshi:moshi:$moshi_version"
|
||||
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
package dev.msfjarvis.lobsters.model
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@Entity(
|
||||
tableName = "lobsters_posts"
|
||||
)
|
||||
@JsonClass(generateAdapter = true)
|
||||
class LobstersPost(
|
||||
@Json(name = "short_id")
|
||||
@PrimaryKey
|
||||
val shortId: String,
|
||||
@Json(name = "short_id_url")
|
||||
val shortIdUrl: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue