添加阅读记录

pull/326/head
gedoor 4 years ago
parent c19057c52f
commit ff13fb6a69
  1. 2
      app/src/main/java/io/legado/app/data/AppDatabase.kt
  2. 19
      app/src/main/java/io/legado/app/data/dao/ReadRecordDao.kt
  3. 2
      app/src/main/java/io/legado/app/data/entities/ReadRecord.kt

@ -19,7 +19,7 @@ import kotlinx.coroutines.launch
ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class,
RssSource::class, Bookmark::class, RssArticle::class, RssReadRecord::class,
RssStar::class, TxtTocRule::class, ReadRecord::class],
version = 16,
version = 17,
exportSchema = true
)
abstract class AppDatabase : RoomDatabase() {

@ -0,0 +1,19 @@
package io.legado.app.data.dao
import androidx.room.*
import io.legado.app.data.entities.ReadRecord
@Dao
interface ReadRecordDao {
@get:Query("select * from readRecord")
val all: List<ReadRecord>
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insert(vararg readRecord: ReadRecord)
@Update
fun update(vararg record: ReadRecord)
}

@ -3,7 +3,7 @@ package io.legado.app.data.entities
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity
@Entity(tableName = "readRecord")
data class ReadRecord(
@PrimaryKey
val bookName: String = "",

Loading…
Cancel
Save