package com.casic.dcms.mvp.presenter;

import com.casic.dcms.bean.CaseStatusBean;
import com.casic.dcms.mvp.BasePresenter;
import com.casic.dcms.mvp.model.CaseStatusModelImpl;
import com.casic.dcms.mvp.view.ICaseStatusView;

public class CaseStatusPresenterImpl extends BasePresenter implements ICaseStatusPresenter, CaseStatusModelImpl.OnGetCaseStatusListener {

    private ICaseStatusView view;
    private CaseStatusModelImpl actionModel;

    public CaseStatusPresenterImpl(ICaseStatusView caseStatusView) {
        this.view = caseStatusView;
        actionModel = new CaseStatusModelImpl(this);
    }

    @Override
    public void onReadyRetrofitRequest() {
        addSubscription(actionModel.sendRetrofitRequest());
    }

    @Override
    public void disposeRetrofitRequest() {
        unSubscription();
    }

    @Override
    public void onSuccess(CaseStatusBean resultBean) {
        view.obtainCaseStatusData(resultBean);
    }

    @Override
    public void onFailure(Throwable throwable) {

    }
}
