package eVVM.apk.ui.alarmwaring; import com.allen.library.RxHttpUtils; import com.allen.library.interceptor.Transformer; import com.allen.library.observer.CommonObserver; import java.util.HashMap; import java.util.Map; import eVVM.apk.api.ApiService; import eVVM.apk.common.MyDataObsever; import eVVM.apk.mvp.MvpModel; import eVVM.apk.ui.toreview.bean.ToreviewBean; /** * Created by Android Studio. * User: zbb * Date: 2019/6/6 * Describe: AlarmModel */ public class AlarmModel extends MvpModel { public AlarmModel() { } public void AlarmList(int page, int size, String doctorId, String factoryId, int type) { Map map = new HashMap<>(); map.put("page", ""+page); map.put("size", ""+size); map.put("doctorId", ""+doctorId); map.put("factoryId", ""+factoryId); map.put("type", ""+type); RxHttpUtils.createApi(ApiService.class) .factorNotreview(map) .compose(Transformer.switchSchedulers()) .subscribe(new MyDataObsever() { @Override protected void onError(String errorMsg) { getListener().onFail(errorMsg); } @Override protected void onSuccess(ToreviewBean alarmBean) { if (alarmBean.getCode() == 200) { getListener().onSucceed(alarmBean.getData()); } else { getListener().onFail(alarmBean.getMsg()); } } }); } }