From c19057c52faf9d419de8adc5955e9e3c548c96d8 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 21 Aug 2020 10:09:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=98=85=E8=AF=BB=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/data/AppDatabase.kt | 4 ++-- .../java/io/legado/app/data/entities/ReadRecord.kt | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/AppDatabase.kt b/app/src/main/java/io/legado/app/data/AppDatabase.kt index 3e50aab3a..08b2265f5 100644 --- a/app/src/main/java/io/legado/app/data/AppDatabase.kt +++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt @@ -18,8 +18,8 @@ import kotlinx.coroutines.launch entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class, ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class, RssSource::class, Bookmark::class, RssArticle::class, RssReadRecord::class, - RssStar::class, TxtTocRule::class], - version = 15, + RssStar::class, TxtTocRule::class, ReadRecord::class], + version = 16, exportSchema = true ) abstract class AppDatabase : RoomDatabase() { diff --git a/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt b/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt index 6daee53f8..cf16a08ab 100644 --- a/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt +++ b/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt @@ -1,4 +1,11 @@ package io.legado.app.data.entities -class ReadRecord { -} \ No newline at end of file +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity +data class ReadRecord( + @PrimaryKey + val bookName: String = "", + val readTime: Long = 0L +) \ No newline at end of file