pull/84/head
parent
0ed336ed8d
commit
864b61ccba
@ -0,0 +1,24 @@ |
||||
package io.legado.app.data.dao |
||||
|
||||
import androidx.room.Dao |
||||
import androidx.room.Insert |
||||
import androidx.room.OnConflictStrategy |
||||
import androidx.room.Query |
||||
import io.legado.app.data.entities.TxtTocRule |
||||
import retrofit2.http.DELETE |
||||
|
||||
@Dao |
||||
interface TxtTocRuleDao { |
||||
|
||||
@get:Query("select * from txtTocRules order by serialNumber") |
||||
val all: List<TxtTocRule> |
||||
|
||||
@get:Query("select * from txtTocRules where enable = 1 order by serialNumber") |
||||
val enabled: List<TxtTocRule> |
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE) |
||||
fun insert(vararg rule: TxtTocRule) |
||||
|
||||
@DELETE |
||||
fun delete(vararg rule: TxtTocRule) |
||||
} |
@ -0,0 +1,14 @@ |
||||
package io.legado.app.data.entities |
||||
|
||||
import androidx.room.Entity |
||||
import androidx.room.PrimaryKey |
||||
|
||||
|
||||
@Entity(tableName = "txtTocRules") |
||||
data class TxtTocRule( |
||||
@PrimaryKey |
||||
var name: String = "", |
||||
var rule: String = "", |
||||
var serialNumber: Int, |
||||
var enable: Boolean = true |
||||
) |
Loading…
Reference in new issue