package com.zj365.dc.vm

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

class OneKeyBinderDeviceVm : BaseVm() {

    val bindResult by lazy { MutableLiveData<RespBody<Any>>() }

    fun binderDevice(dataCode:String){

        startHttp(true) {
            val jsonObject =JSONObject()
            jsonObject.put("dataCode",dataCode)
            val body = apiInterface().binderDevice(retrofits.getRequestBody(jsonObject.toString()))
            body.getCodeStatus(bindResult,nowData)
        }
    }
}