package com.gh.gamecenter.room.dao

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

@Dao
interface AnswerHistoryDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addAnswer(answer: AnswerEntity)

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

    @Delete
    fun deleteAnswer(answer: AnswerEntity)

}
