package com.xty.network.model

data class BloodFatHeadInfo(
    val `data`: Data,
    val expireTime: String,
    val status: Int
){
    val headData:MutableList<BloodFat>
        get() {
            val list:MutableList<BloodFat> = mutableListOf()
            val tc = BloodFat(data.tc,data.time,BloodFatType.Tc)
            val tg = BloodFat(data.tg,data.time,BloodFatType.Tg)
            val hdl = BloodFat(data.hdl,data.time,BloodFatType.Hdl)
            val ldl = BloodFat(data.ldl,data.time,BloodFatType.Ldl)

            list.add(tc)
            list.add(tg)
            list.add(hdl)
            list.add(ldl)

            return list
        }

    data class BloodFat(val value:Float,val time:String,val type:BloodFatType)

    data class Data(
        val createTime: String,
        val hdl: Float,
        val id: String,
        val ldl: Float,
        val tc: Float,
        val tg: Float,
        val time: String,
        val timeDay: String,
        val timeMonth: String,
        val timeYear: String,
        val userId: String
    )
}

enum class BloodFatType(title:String){

    Tc("tc"),
    Tg("tg"),
    Hdl("hdl"),
    Ldl("ldl")

}

