package com.zxhl.main.page.presenter


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.chat.ConstellationEntity
import com.zxhl.cms.net.model.chat.StarMachEntity
import com.zxhl.main.page.contract.StarMachContract

class StarMachPresenter : StarMachContract.Presenter {

    private val mView: StarMachContract.View


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

    override fun getStarMachReslut() {
        ApiClient.homeApi.getStarMachReslut()
            .compose(RxSchedulers.observableIO2Main())
            .subscribe(object : BaseObserver<StarMachEntity>() {
                override fun onSuccess(result: StarMachEntity?) {
                    mView.setReslut(result)
                }

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

                }
            })
    }


}