package com.gh.gamecenter.room.dao

import androidx.room.*
import com.gh.gamecenter.qa.entity.ArticleEntity
import io.reactivex.Single

@Dao
interface ArticleHistoryDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addArticle(answer: ArticleEntity)

    @Query("select * from ArticleEntity order by orderTag desc limit :pageSize offset :offset ")
    fun getArticleWithOffset(pageSize: Int, offset: Int): Single<List<ArticleEntity>>

    @Delete
    fun deleteArticle(article: ArticleEntity)

}
