package com.zxbw.modulemain.presenter

import com.zxbw.modulemain.contract.FlashSaleContract
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.qy.SkillEntity

class FlashSalePresenter : FlashSaleContract.Presenter {
    private val mView: FlashSaleContract.View

    constructor(mView: FlashSaleContract.View) {
        this.mView = mView
    }

    override fun getFlashSaleData() {
        ApiClient.homeApi.getskill().compose(RxSchedulers.observableIO2Main())
            .subscribe(object : BaseObserver<List<SkillEntity>>() {
                override fun onSuccess(result: List<SkillEntity>?) {
                    mView.setData(result)
                }

                override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {

                }
            })
    }
}