package com.zj365.health.vm

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

class DkVM : BaseVm() {

    val dkInfo by lazy{ MutableLiveData<RespBody<DkBean>>() }
    val dkOpration by lazy {MutableLiveData<RespBody<String>>()}

    fun getDkInfo() {
        startHttp {
          var body=  apiInterface().getDkInfo("")
            body.getCodeStatus(dkInfo,nowData)
        }
    }

    fun getDkList() {
        startHttp {
           // apiInterface().getDkList()
        }
    }

    fun clickDk(position:Int) {
        startHttp {
            var json=JSONObject()
            json.put("type",position)
          var body= apiInterface().clickDk(retrofits.getRequestBody(json.toString()))
            body.getCodeStatus(dkOpration,nowData)
        }
    }

}