package com.gh.gamecenter.room.dao

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

@Dao
interface NewsHistoryDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addNews(news: NewsEntity)

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

    @Delete
    fun deleteNews(news: NewsEntity)

}
