From ef20591cba97b5c18b12b6ea3d0d751a6669d9d7 Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期三, 26 三月 2025 14:22:04 +0800 Subject: [PATCH] fix 修改表字段前版本 --- app/src/main/java/com/example/firstapp/database/entity/KeywordConfig.kt | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/app/src/main/java/com/example/firstapp/database/entity/KeywordConfig.kt b/app/src/main/java/com/example/firstapp/database/entity/KeywordConfig.kt index 2a3e3a2..c7cfca8 100644 --- a/app/src/main/java/com/example/firstapp/database/entity/KeywordConfig.kt +++ b/app/src/main/java/com/example/firstapp/database/entity/KeywordConfig.kt @@ -8,4 +8,13 @@ val type: String, val keyword: String, val isEnable: Boolean -) +){ + fun toEntity(): KeywordEntity { + return KeywordEntity( + id = id, // 确保与@Entity类字段匹配 + type = type, + keyword = keyword, + isEnabled = isEnable // 注意字段名是否一致(isEnabled vs isEnable) + ) + } +} -- Gitblit v1.9.3