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.PackageCaseModelImpl;
import com.casic.dcms.mvp.presenter.IPackageCasePresenter;
import com.casic.dcms.mvp.view.IPackageCaseView;

public class PackageTodoPresenterImpl extends BasePresenter implements IPackageCasePresenter, OnGetPackageCaseListener {

    private final IPackageCaseView view;
    private final PackageCaseModelImpl actionModel;

    public PackageTodoPresenterImpl(IPackageCaseView packageListView) {
        this.view = packageListView;
        actionModel = new PackageCaseModelImpl(this);
    }

    //三包待办
    @Override
    public void onReadyRetrofitRequest(String isShop, int offset) {
        addSubscription(actionModel.sendPackageCaseRequest(isShop, offset, false));
    }

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

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

    @Override
    public void onFailure(Throwable throwable) {

    }
}
