From 93775e1f3d79a1e11b839abbf24201dafcd9e646 Mon Sep 17 00:00:00 2001 From: tj <1378534974@qq.com> Date: 星期五, 25 四月 2025 13:45:56 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- app/src/main/java/com/example/firstapp/database/dao/KeywordDao.kt | 40 +++++++++++++++++++++++++++------------- 1 files changed, 27 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/example/firstapp/database/dao/KeywordDao.kt b/app/src/main/java/com/example/firstapp/database/dao/KeywordDao.kt index f4011d5..f128430 100644 --- a/app/src/main/java/com/example/firstapp/database/dao/KeywordDao.kt +++ b/app/src/main/java/com/example/firstapp/database/dao/KeywordDao.kt @@ -7,21 +7,35 @@ import androidx.room.Update import com.example.firstapp.database.entity.KeywordConfig import com.example.firstapp.database.entity.KeywordEntity +import io.reactivex.Completable -@Dao -interface KeywordDao { - @Query("SELECT * FROM keywords") - fun getAllKeywords(): List<KeywordEntity> - +//@Dao +//interface KeywordDao { +// @Query("SELECT * FROM keywords") +// fun getAllKeywords(): List<KeywordEntity> +// // @Insert(onConflict = OnConflictStrategy.REPLACE) // suspend fun insertAll(keywords: List<KeywordEntity>) // -// @Query("DELETE FROM keywords") -// suspend fun deleteAll() // -// @Update -// suspend fun update(keyword: KeywordEntity) -// -// @Query("SELECT * FROM keywords WHERE isEnabled = 1") -// fun getEnabledKeywords(): List<KeywordConfig> -} +//// +//// @Query("DELETE FROM keywords") +//// suspend fun deleteAll() +//// +//// @Update +//// suspend fun update(keyword: KeywordEntity) +//// +//// @Query("SELECT * FROM keywords WHERE isEnabled = 1") +//// fun getEnabledKeywords(): List<KeywordConfig> +//} +@Dao +interface KeywordDao { + @Insert(onConflict = OnConflictStrategy.REPLACE) + fun insertAll(keywords: List<KeywordEntity>) + + @Query("SELECT * FROM keywords") + fun getAllKeywords(): List<KeywordEntity> + + @Query("DELETE FROM keywords") + fun deleteAll(): Completable +} \ No newline at end of file -- Gitblit v1.9.3