package com.develop.setting.ui.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.scopeNetLife
import com.develop.base.mvvm.BaseViewModel
import com.develop.common.data_repo.net.Api
import com.develop.common.data_repo.net.model.request.DeviceInfoBody
import com.develop.common.data_repo.net.model.response.DevInfoResult
import com.drake.net.Post

class AboutViewModel : BaseViewModel() {

    var devInfoLiveData = MutableLiveData<DevInfoResult>()


    fun getDevInfo() = scopeNetLife {
        val result = Post<DevInfoResult>(Api.DEV_INFO) {
            body = DeviceInfoBody.genDeviceInfoBody()
        }.await()
        devInfoLiveData.postValue(result)
    }
}