package com.cooleshow.teacher.presenter.main;

import com.cooleshow.base.presenter.BasePresenter;
import com.cooleshow.base.rx.BaseObserver;
import com.cooleshow.teacher.api.APIService;
import com.cooleshow.teacher.bean.TeacherUserInfo;
import com.cooleshow.teacher.contract.HomeContract;
import com.cooleshow.teacher.contract.MineContract;
import com.cooleshow.usercenter.bean.UserInfo;

/**
 * Author by pq, Date on 2022/4/20.
 */
public class MinePresenter extends BasePresenter<MineContract.MineView> implements MineContract.Presenter {

    /**
     * 查询UserInfo
     *
     * @param
     */
    public void getUserInfo() {
        addSubscribe(create(APIService.class).getUserInfo(), new BaseObserver<UserInfo>(getView()) {
            @Override
            protected void onSuccess(UserInfo data) {
//                if (getView() != null) {
//                    getView().getUserInfoSuccess(data);
//                }
            }
        });
    }

    public void getTeacherUserInfo() {
        addSubscribe(create(APIService.class).getTeacherUserInfo(), new BaseObserver<TeacherUserInfo>(getView()) {
            @Override
            protected void onSuccess(TeacherUserInfo data) {
//                if (getView() != null) {
//                    getView().getTeacherInfoSuccess(data);
//                }
            }
        });
    }
}
