package com.zxhl.main.page.view

import android.util.Log
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.callback.BaseObserver

class RecoverPopupPresenter : RecoverPopupContract.Presenter {
    private val mView: RecoverPopupContract.View


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


    override fun recoverGoods(depotIds: String,recovetype:String) {
        ApiClient.homeApi.recoverGoods(depotIds,recovetype)
            .compose(RxSchedulers.observableIO2Main())
            .subscribe(object : BaseObserver<Any>() {
                override fun onSuccess(result: Any?) {
                    mView.recoverSuccess()
                }

                override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
                    Log.e("MXL", "c" + code + errorMsg + e)
                }
            })
    }

}