cloudroam
2025-02-25 0fce8fea0b83afb02b5d8780160787e87b8ceedb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.example.firstapp.database.entity
 
/**
 *   关键字策略匹配类
 */
data class KeywordConfig(
    val id: Long = 0, // 自增长的 id
    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)
        )
    }
}