package com.zj365.health.vm

import androidx.lifecycle.MutableLiveData
import com.alibaba.fastjson.JSONObject
import com.xty.base.vm.BaseVm
import com.xty.network.model.HealthReportListBean
import com.xty.network.model.RespBody

class HealthRecordsListVm : BaseVm() {

    val healthReportListLiveData by lazy { MutableLiveData<RespBody<HealthReportListBean>>() }

    fun getHealthRecordList(title:String?,pageNum:String){
        startHttp {
            var json = JSONObject()
            title?.let {
                json.put("title",title)

            }
            json.put("pageNum",pageNum)
            json.put("pageSize",10)
            var response = apiInterface().getHealthReportList(retrofits.getRequestBody(json.toString()))
            response.getCodeStatus(healthReportListLiveData, nowData)
        }
    }
}