package com.casic.dcms.mvp.presenter;

import com.casic.dcms.bean.CaseVerifiedBean;
import com.casic.dcms.mvp.BasePresenter;
import com.casic.dcms.mvp.model.CaseVerifiedModelImpl;
import com.casic.dcms.mvp.view.ICaseVerifiedView;

public class CaseVerifiedPresenterImpl extends BasePresenter implements ICaseVerifiedPresenter, CaseVerifiedModelImpl.OnGetCaseVerifiedListener {

    private ICaseVerifiedView view;
    private CaseVerifiedModelImpl actionModel;

    public CaseVerifiedPresenterImpl(ICaseVerifiedView caseVerifiedView) {
        this.view = caseVerifiedView;
        actionModel = new CaseVerifiedModelImpl(this);
    }

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

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

    @Override
    public void onSuccess(CaseVerifiedBean resultBean) {
        view.obtainVerifiedListResult(resultBean);
    }

    @Override
    public void onFailure(Throwable throwable) {

    }
}
