package com.cooleshow.teacher.presenter.homePage;

import com.cooleshow.base.presenter.BasePresenter;
import com.cooleshow.base.rx.BaseObserver;
import com.cooleshow.teacher.api.APIService;
import com.cooleshow.teacher.bean.TeacherSelfStyleInfoBean;
import com.cooleshow.teacher.bean.TeacherUserInfo;
import com.cooleshow.teacher.contract.HomePageContract;
import com.cooleshow.teacher.contract.MineStyleContract;
import com.cooleshow.usercenter.bean.UserInfo;

/**
 * Author by pq, Date on 2022/4/20.
 */
public class MineStylePresenter extends BasePresenter<MineStyleContract.MineStylePageView> implements MineStyleContract.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);
//                }
            }
        });
    }

    @Override
    public void getTeacherSelfStyle() {
        addSubscribe(create(APIService.class).getTeacherSelfStyle(), new BaseObserver<TeacherSelfStyleInfoBean>(getView()) {
            @Override
            protected void onSuccess(TeacherSelfStyleInfoBean data) {
                if (getView() != null) {
                    getView().getSelfStyleSuccess(data);
                }
            }
        });
    }
}
