package com.zj365.health.vm

import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.DeviceFunctionBean
import com.xty.network.model.RespBody
import org.json.JSONObject

class ComparePageDataVm :BaseVm() {

    val functionLiveData by lazy { MutableLiveData<RespBody<MutableList<DeviceFunctionBean>>>() }
    fun getDeviceFunctionList(id:String){
        startHttp {
            val json = JSONObject()
            json.put("id", id)
            val body = apiInterface().getDeviceFunctionList(retrofits.getRequestBody(json.toString()))
            body.getCodeStatus(functionLiveData, nowData)
        }
    }
}