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

import com.casic.dcms.bean.CaseLargeClassBean;
import com.casic.dcms.listener.OnGetLargeClassListener;
import com.casic.dcms.mvp.BasePresenter;
import com.casic.dcms.mvp.model.impl.CaseLargeClassModelImpl;
import com.casic.dcms.mvp.presenter.ICaseLargeClassPresenter;
import com.casic.dcms.mvp.view.ICaseLargeClassView;

public class CaseLargeClassPresenterImpl extends BasePresenter implements ICaseLargeClassPresenter, OnGetLargeClassListener {

    private final ICaseLargeClassView view;
    private final CaseLargeClassModelImpl actionModel;

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

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

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

    @Override
    public void onFailure(Throwable throwable) {

    }

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