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

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import kotlinx.serialization.Serializable

/**
 * 文件表
 */
@Entity(tableName = "file")
@Serializable
data class FileEntity(
    @PrimaryKey(autoGenerate = false) val id: String,
    @ColumnInfo(name = "biz_type") val bizType: String?,            // 业务类型(object:对象附件|problem_arch:空间问题附件|problem_equip:设备问题附件)
    @ColumnInfo(name = "file_path") val filePath: String?,          // 文件存储路径
    @ColumnInfo(name = "file_type") val fileType: String?,          // 文件类型(photo|video|file|...)
    @ColumnInfo(name = "client_path") val clientPath: String?,      // app端文件存储路径
    @ColumnInfo(name = "ref_obj_id") val refObjId: String?,         // 关联的对象id
    @ColumnInfo(name = "ref_info_code") val refInfoCode: String?,   // 关联的对象信息点code
    @ColumnInfo(name = "remark") val remark: String?,               // 描述
    @ColumnInfo(name = "order_num") val orderNum: Int?,             // 文件附件(照片)的排序序号
    @ColumnInfo(name = "project_id") val projectId: String?,        // 项目id
    @ColumnInfo(name = "building_id") val buildingId: String?,      // 建筑id
    @ColumnInfo(name = "floor_id") val floorId: String?,            // 楼层id
    @ColumnInfo(name = "creator") val creator: String?,             // 创建人
    @ColumnInfo(name = "creation_time") val creationTime: String?,  // 创建时间
    @ColumnInfo(name = "modifier") val modifier: String?,           // 修改人
    @ColumnInfo(name = "modified_time") var modifiedTime: String?,  // 修改时间
    @ColumnInfo(name = "valid") val valid: Int?,                    // 合法标识
    @ColumnInfo(name = "upload_flag") val uploadFlag: String?,      // app端上传数据标记
    @ColumnInfo(name = "state") var state: String? = "0"             // 数据状态：0：未处理，1：已处理 2：已上传
)