package com.zj365.dc.vm

import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.RespBody
import com.xty.network.model.SystemMsgDataResp

class MessageVm(): BaseVm() {

     val msgData by lazy { MutableLiveData<RespBody<SystemMsgDataResp>> ()}

     val msgAllRead by lazy { MutableLiveData<RespBody<Any>>() }
    fun getSystemMsg(){
        startHttp {
            var response = apiInterface().getSystemMsg()
            response.getCodeStatus(msgData, nowData)
        }
    }

    fun setAllRead(){
        startHttp(true) {
            var response = apiInterface().setMessageReadAll()
            response.getCodeStatus(msgAllRead, nowData)
        }
    }
}