package com.framework.mvvm.model.db.entity.dict

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.JsonElement

/**
 * info 表
 * 通过 code 和 classCode 的各种组合来使用
 * code : Info 本身编码，
 * classCode : 设备编码，对应多个 info
 * 关系：一个 classCode 下有多个 code；不同 classCode 下的 code 可能相同
 */
@Entity(tableName = "info")
data class InfoEntity(
    @PrimaryKey(autoGenerate = true) val id: Int = 0,
    @ColumnInfo(name = "group_code") val groupCode: String? = null,
    @ColumnInfo(name = "project_id") val projectId: String? = null,
    @ColumnInfo(name = "code") val code: String? = null,              // Info 编码
    @ColumnInfo(name = "name") val name: String? = null,
    @ColumnInfo(name = "alias_code") val aliasCode: String? = null,
    @ColumnInfo(name = "class_code") val classCode: String? = null,   // 类型编码
    @ColumnInfo(name = "first_tag") val firstTag: String? = null,
    @ColumnInfo(name = "second_tag") val secondTag: String? = null,
    @ColumnInfo(name = "input_mode") val inputMode: String? = null,
    @ColumnInfo(name = "unit") val unit: String? = null,
    @ColumnInfo(name = "data_type") val dataType: String? = null,
    @ColumnInfo(name = "data_source") val dataSource: JsonElement? = null,
    @ColumnInfo(name = "show_order") val showOrder: Long? = null,
    @ColumnInfo(name = "version") val version: String? = null
    // String aliasName;
    // Boolean isMultiple = false;
    // Boolean isRegion = false;
)