package com.cooleshow.teacher.presenter.course;

import com.cooleshow.base.presenter.BasePresenter;
import com.cooleshow.base.rx.BaseObserver;
import com.cooleshow.teacher.api.APIService;
import com.cooleshow.teacher.bean.QuerySubjectBean;
import com.cooleshow.teacher.contract.HomeContract;
import com.cooleshow.teacher.contract.MineCourseContract;

import java.util.List;

/**
 * Author by pq, Date on 2022/4/20.
 */
public class MineCoursePresenter extends BasePresenter<MineCourseContract.MineCourseView> implements MineCourseContract.Presenter {
    public void querySubjectItem() {
        addSubscribe(create(APIService.class).querySubjectItem(), new BaseObserver<List<QuerySubjectBean>>(getView()) {
            @Override
            protected void onSuccess(List<QuerySubjectBean> data) {
                if (getView() != null) {
                    getView().querySubjectItemSuccess(data);
                }
            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);

            }
        });
    }
}
