package com.yidian.shenghuoquan.bgoods.ui.coupon.viewmodel

import androidx.lifecycle.MutableLiveData
import com.yidian.bcommon.mvvm.BaseViewModel
import com.yidian.shenghuoquan.bgoods.dto.CommodityStatus
import com.yidian.shenghuoquan.bgoods.http.CouponDataSource
import com.yidian.shenghuoquan.bgoods.http.callback.IGetCommodityStatusListCallback

/**
 * author: yinjiacheng
 * date: 7/1/21 8:01 PM
 * description: 商品管理
 */
class CommodityManagementViewModel : BaseViewModel(), IGetCommodityStatusListCallback {

  /**
   * 商品状态数据
   */
  val commodityStatusList by lazy { MutableLiveData<ArrayList<CommodityStatus>>() }

  /**
   * 请求商品状态列表
   */
  fun requestCommodityStatusList() {
    CouponDataSource.getCommodityStatusList(this)
  }

  override fun getCommodityStatusListSuccess(result: ArrayList<CommodityStatus>?) {
    // 数据回传
    commodityStatusList.value = result
  }

  override fun getCommodityStatusListFailure(message: String?) {

  }

}
