package com.zj365.health.vm

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

class AddFamilyGuardianVm : BaseVm() {

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

    fun addFamily(relation:String,phone:String,guardian:String){
        startHttp (true){
            val json = JSONObject()
            json.put("relation",relation)
            json.put("phone",phone)
            json.put("guardian",guardian)

            val body = apiInterface().addFamilyGuardian(retrofits.getRequestBody(json.toString()))
            body.getCodeStatus(submitLiveData,nowData)

        }
    }
}