package com.bc_chat.bc_base.presenter

import com.bc_chat.bc_base.contract.WithdrawRecordContract
import com.bc_chat.bc_base.entity.wallet.WithdrawRecordBean
import com.bc_chat.bc_base.task.WithdrawRecordTask
import com.zhaohaoting.framework.abs.presenter.BasePresenter
import com.zhaohaoting.framework.requset.NetWorkCallBack

/**
 * author：Created by zhaohaoting on 2019/7/19
 * email：526309416@qq.com
 * desc：
 */
class WithdrawRecordPresenter<VIEW : WithdrawRecordContract.View>(view: VIEW) : BasePresenter<VIEW>(view), WithdrawRecordContract.Presenter {
    override fun getWithdrawRecord(page_num: Int, page_size: Int) {
        taskHelper.execute<Any>(WithdrawRecordTask(page_num, page_size), object : NetWorkCallBack<List<WithdrawRecordBean>>() {
            override fun onPreExecute(task: Any?) {
                super.onPreExecute(task)
                view.showLoading(task)
            }

            override fun onPostExecuteSuccess(task: Any?, data: List<WithdrawRecordBean>?) {
                view.dismissLoading(task)
                view.getWithdrawRecordSuccess(data)
            }

            override fun onPostExecuteFailure(task: Any?, exception: java.lang.Exception?) {
                super.onPostExecuteFailure(task, exception)
                view.dismissLoading(task)
                view.getWithdrawRecordFailure(exception)
            }
        })
    }


}
