package com.zj365.health.vm

import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.BalanceDietBean
import com.xty.network.model.HealthArchiveBean
import com.xty.network.model.RespBody

class HealthRecordMainVm : BaseVm() {

    val balanceDietBeanLiveData by lazy { MutableLiveData<RespBody<BalanceDietBean>>() }

    val healthArchiveLiveData by lazy { MutableLiveData<RespBody<HealthArchiveBean>>() }

    fun getBalanceDiet(){
        startHttp (false){
            var response = apiInterface().getBalanceDiet()
            response.getCodeStatus(balanceDietBeanLiveData, nowData)
        }
    }

    fun getHealthArchive(){
        startHttp {
            var response = apiInterface().getHealthArchive()
            response.getCodeStatus(healthArchiveLiveData, nowData)
        }
    }
}