package com.casic.dcms.mvp.presenter;

import com.casic.dcms.bean.CaseVerifyBean;
import com.casic.dcms.mvp.BasePresenter;
import com.casic.dcms.mvp.model.CaseVerifyModelImpl;
import com.casic.dcms.mvp.view.ICaseVerifyView;

public class CaseVerifyPresenterImpl extends BasePresenter implements ICaseVerifyPresenter, CaseVerifyModelImpl.OnGetCaseVerifyListener {

    private ICaseVerifyView view;
    private CaseVerifyModelImpl actionModel;

    public CaseVerifyPresenterImpl(ICaseVerifyView caseVerifyView) {
        this.view = caseVerifyView;
        actionModel = new CaseVerifyModelImpl(this);
    }

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

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

    @Override
    public void onSuccess(CaseVerifyBean resultBean) {
        view.obtainVerifyListResult(resultBean);
    }

    @Override
    public void onFailure(Throwable throwable) {

    }
}
