package com.zj365.health.vm

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

class QuestListVm: BaseVm() {
    val question by lazy{MutableLiveData<RespBody<QuestBean>>()}
    val subLive by lazy{MutableLiveData<RespBody<String>>()}
    fun getQuestList(){
        startHttp {
            var request=apiInterface().getQuestList()
            request.getCodeStatus(question,nowData)
        }
    }
    fun submitQuest(jsonArray: JSONArray){
        startHttp {
            var request=apiInterface().submitQuest(retrofits.getRequestBody(jsonArray.toString()))
            request.getCodeStatus(subLive,nowData)
        }
    }
}