package com.zj365.mime.vm

import androidx.lifecycle.MutableLiveData
import com.hjq.toast.ToastUtils
import com.xty.base.vm.BaseVm
import com.xty.common.LogUtils
import com.xty.network.model.BindRespone
import com.xty.network.model.MyOrganCodeBean
import com.xty.network.model.RespBody

class MyOrganVm:BaseVm() {

    val unBindingLive by lazy { MutableLiveData<RespBody<String>>() }
      val BindingResponeLive by lazy { MutableLiveData<RespBody<BindRespone>>() }
    val myOrganLive by lazy{ MutableLiveData<RespBody<MyOrganCodeBean>>() }


    //  获取机构授权码
    fun getMyOrgan(){
        startHttp {
            var response=apiInterface().getUserAuthCode()
            response.getCodeStatus(myOrganLive,nowData)
        }
    }
    fun bindAuthCode(code: String) {
        startHttp {
            var response=apiInterface().bindAuthCode(code)
            response.getCodeStatus(BindingResponeLive,nowData)
        }
    }
}