package com.ym.game.presenter

import com.ym.game.contract.CashExchangeContract
import com.ym.library.module.GameDuiHuanShopEntity
import com.ym.library.module.WithDrawEntity2
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers

class CashExchangePresenter : CashExchangeContract.Presenter {

    var mView: CashExchangeContract.View

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

    override fun getWithDrawList() {

        GameApiClient.gameApi.getDuiHuanShop().compose(RxSchedulers.observableIO2Main())
            .subscribe(object : BaseObserver<List<GameDuiHuanShopEntity>>() {
                override fun onSuccess(result: List<GameDuiHuanShopEntity>) {
                    mView?.WithDrawListResult(result)
                }

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

                }
            })

//        GameApiClient.gameApi.getWithDrawList().compose(
//            RxSchedulers.observableIO2Main()
//        ).subscribe(object : BaseObserver<WithDrawEntity2>() {
//            override fun onSuccess(result: WithDrawEntity2?) {
//                if (result != null) {
//                    mView?.WithDrawListResult(result)
//                }
//            }
//
//            override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
//        })
    }

    override fun dowd() {
    }

}