package com.casic.dcms.mvp.presenter;

import com.casic.dcms.bean.CaseCheckBean;
import com.casic.dcms.mvp.BasePresenter;
import com.casic.dcms.mvp.model.CaseCheckModelImpl;
import com.casic.dcms.mvp.view.ICaseCheckView;

public class CaseCheckPresenterImpl extends BasePresenter implements ICaseCheckPresenter, CaseCheckModelImpl.OnGetCaseCheckListener {

    private ICaseCheckView view;
    private CaseCheckModelImpl actionModel;

    public CaseCheckPresenterImpl(ICaseCheckView caseTodoView) {
        this.view = caseTodoView;
        actionModel = new CaseCheckModelImpl(this);
    }

    @Override
    public void onReadyRetrofitRequest(int limit, int offset) {
        addSubscription(actionModel.sendRetrofitRequest(limit, offset));
    }

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

    @Override
    public void onSuccess(CaseCheckBean resultBean) {
        view.obtainCheckListResult(resultBean);
    }

    @Override
    public void onFailure(Throwable throwable) {

    }
}
