package com.cooleshow.student.presenter.course;

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

import java.util.List;

/**
 * 创建日期：2022/5/30 9:25
 *
 * @author Ryan
 * 类说明：
 */
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);

            }
        });
    }
}
