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.main.page.contract.ConstellationContract

class ConstellationPresenter:ConstellationContract.Presenter {

    private val mView: ConstellationContract.View


    constructor(mView: ConstellationContract.View) {
        this.mView = mView
    }
    override fun getConstellationPairing(date:String) {
        ApiClient.homeApi.getConstellation(date).compose(RxSchedulers.observableIO2Main())
            .subscribe(object : BaseObserver<ConstellationEntity>() {
                override fun onSuccess(result:ConstellationEntity?) {
                    mView.setReslut(result)
                }

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

                }
            })
    }
}