package com.casic.dcms.mvp.presenter.impl;

import com.casic.dcms.bean.PackageOrDeptBean;
import com.casic.dcms.listener.OnGetPackageCaseListener;
import com.casic.dcms.mvp.BasePresenter;
import com.casic.dcms.mvp.model.impl.DeptCaseModelImpl;
import com.casic.dcms.mvp.presenter.IDeptCasePresenter;
import com.casic.dcms.mvp.view.IDeptTodoOrHandledView;

public class DeptHandledPresenterImpl extends BasePresenter implements IDeptCasePresenter, OnGetPackageCaseListener {

    private final IDeptTodoOrHandledView view;
    private final DeptCaseModelImpl actionModel;

    public DeptHandledPresenterImpl(IDeptTodoOrHandledView deptCaseView) {
        this.view = deptCaseView;
        actionModel = new DeptCaseModelImpl(this);
    }

    //二级处理完毕
    @Override
    public void onReadyRetrofitRequest(int offset) {
        addSubscription(actionModel.sendDeptCaseRequest(offset, "handled"));
    }

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

    @Override
    public void onSuccess(PackageOrDeptBean resultBean) {
        view.obtainResult(resultBean);
    }

    @Override
    public void onFailure(Throwable throwable) {

    }
}
