package com.casic.dcms.mvp.presenter;

import com.casic.dcms.bean.CaseLargeClassBean;
import com.casic.dcms.mvp.BasePresenter;
import com.casic.dcms.mvp.model.CaseLargeClassModelImpl;
import com.casic.dcms.mvp.view.ICaseLargeClassView;

public class CaseLargeClassPresenterImpl extends BasePresenter implements ICaseLargeClassPresenter, CaseLargeClassModelImpl.OnGetLargeClassListener {

    private ICaseLargeClassView view;
    private CaseLargeClassModelImpl actionModel;

    public CaseLargeClassPresenterImpl(ICaseLargeClassView caseTypeView) {
        this.view = caseTypeView;
        actionModel = new CaseLargeClassModelImpl(this);
    }

    @Override
    public void onReadyRetrofitRequest(String eorc) {
        addSubscription(actionModel.sendRetrofitRequest(eorc));
    }

    @Override
    public void onSuccess(CaseLargeClassBean resultBean) {
        view.obtainLargeClassData(resultBean);
    }

    @Override
    public void onFailure(Throwable throwable) {

    }

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