37 lines
1.2 KiB
Kotlin
37 lines
1.2 KiB
Kotlin
package com.yizhuan.erban.association
|
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
import com.yizhuan.erban.base.BaseViewModel
|
|
import com.yizhuan.xchat_android_core.association.AssociationModel
|
|
import com.yizhuan.xchat_android_core.association.HallListInfo
|
|
import com.yizhuan.xchat_android_core.association.ClanListInfo
|
|
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
|
import com.yizhuan.xchat_android_core.utils.toast
|
|
|
|
class AssociationViewModel : BaseViewModel() {
|
|
|
|
//公会列表
|
|
private val _clanListLiveData = MutableLiveData<List<ClanListInfo>?>()
|
|
val clanListLiveData: MutableLiveData<List<ClanListInfo>?> = _clanListLiveData
|
|
|
|
//牌照房列表
|
|
private val _hallListLiveData = MutableLiveData<List<HallListInfo>?>()
|
|
val hallListLiveData: MutableLiveData<List<HallListInfo>?> = _hallListLiveData
|
|
|
|
fun getClanList() {
|
|
safeLaunch(
|
|
block = {
|
|
_clanListLiveData.value = AssociationModel.getClanList()
|
|
}
|
|
)
|
|
}
|
|
|
|
fun getHallList() {
|
|
safeLaunch(
|
|
block = {
|
|
_hallListLiveData.value = AssociationModel.getHallList()
|
|
}
|
|
)
|
|
}
|
|
|
|
} |