package com.zswc.creativity.vmodel

import android.app.Application
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.zswc.creativity.model.ArticleInfo
import com.zswc.creativity.model.MsgGet
import com.zswc.creativity.utils.net.NetEngine
import com.ysnows.base.base.BRepository
import com.ysnows.base.base.BViewModel
import com.zswc.creativity.model.MsgList
import kotlinx.coroutines.launch

class ArticleDetailVModel(application: Application) : BViewModel<BRepository>(application) {


    var bean: MutableLiveData<ArticleInfo> = MutableLiveData()
    var isShow:MutableLiveData<Boolean> = MutableLiveData(false)

    var msgGetInfo: MutableLiveData<MsgList> = MutableLiveData()

    var chsoe=MutableLiveData<String>()


    fun getInfo() {


        viewModelScope.launch {

           var it= repository().preq {NetEngine.service.articleInfo()   }
            if (it.ok()) {
                bean.value=it.data()
            }

        }


    }




}
