From 456a2e304363267a88a306a5d05b1b12dbd54a8f Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 3 Nov 2019 15:42:33 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/data/dao/CookieDao.kt | 13 +++++++++++++ .../main/java/io/legado/app/data/entities/Cookie.kt | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 app/src/main/java/io/legado/app/data/dao/CookieDao.kt create mode 100644 app/src/main/java/io/legado/app/data/entities/Cookie.kt diff --git a/app/src/main/java/io/legado/app/data/dao/CookieDao.kt b/app/src/main/java/io/legado/app/data/dao/CookieDao.kt new file mode 100644 index 000000000..93f613ae4 --- /dev/null +++ b/app/src/main/java/io/legado/app/data/dao/CookieDao.kt @@ -0,0 +1,13 @@ +package io.legado.app.data.dao + +import androidx.room.Dao +import androidx.room.Query + +@Dao +interface CookieDao { + + @Query("select * from cookies where url = :url") + fun get(url: String) + + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/Cookie.kt b/app/src/main/java/io/legado/app/data/entities/Cookie.kt new file mode 100644 index 000000000..fd1ec1840 --- /dev/null +++ b/app/src/main/java/io/legado/app/data/entities/Cookie.kt @@ -0,0 +1,11 @@ +package io.legado.app.data.entities + +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity(tableName = "cookies") +data class Cookie( + @PrimaryKey + var url: String, + var cookie: String +) \ No newline at end of file