pull/37/head
kunfei 5 years ago
parent 82435f601c
commit 0feab3459e
  1. 6
      app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt
  2. 2
      app/src/main/java/io/legado/app/data/entities/RssArticle.kt

@ -7,10 +7,10 @@ import io.legado.app.data.entities.RssArticle
@Dao @Dao
interface RssArticleDao { interface RssArticleDao {
@Query("select * from rssArticles where guid = :key") @Query("select * from rssArticles where origin = :origin and title = :title")
fun get(key: String): RssArticle? fun get(origin: String, title: String): RssArticle?
@Query("select * from rssArticles where origin = :origin order by time desc") @Query("select * from rssArticles where origin = :origin order by `order` desc")
fun liveByOrigin(origin: String): LiveData<List<RssArticle>> fun liveByOrigin(origin: String): LiveData<List<RssArticle>>
@Insert(onConflict = OnConflictStrategy.IGNORE) @Insert(onConflict = OnConflictStrategy.IGNORE)

@ -11,7 +11,7 @@ import androidx.room.Ignore
data class RssArticle( data class RssArticle(
var origin: String = "", var origin: String = "",
var title: String? = null, var title: String? = null,
var time: Long = System.currentTimeMillis(), var order: Long = 0,
var author: String? = null, var author: String? = null,
var link: String? = null, var link: String? = null,
var pubDate: String? = null, var pubDate: String? = null,

Loading…
Cancel
Save