package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.biz.dal.dto.TeacherDto;
import com.yonge.cooleshow.biz.dal.dto.req.TeacherSubmitReq;
import com.yonge.cooleshow.biz.dal.dto.search.TeacherSearch;
import com.yonge.cooleshow.biz.dal.entity.Subject;
import com.yonge.cooleshow.biz.dal.entity.Teacher;
import com.yonge.cooleshow.biz.dal.entity.TeacherStyleVideo;
import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
import com.yonge.cooleshow.biz.dal.queryInfo.TeacherQueryInfo;
import com.yonge.cooleshow.biz.dal.vo.*;
import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherWrapper;
import com.yonge.cooleshow.common.entity.HttpResponseResult;

import java.util.List;

/**
 * 教师表 服务类
 *
 * @author liweifan
 * @date 2022-03-18
 */
public interface TeacherService extends IService<Teacher> {
    /***
     * 查询老师详情
     * @author liweifan
     * @param: userId
     * @updateTime 2022/3/23 17:49
     * @return: com.yonge.cooleshow.biz.dal.vo.TeacherVo
     */
    TeacherVo detail(Long userId);

    /**
     * 自定义分页
     *
     * @author liweifan
     * @date 2022-03-18
     */
    IPage<TeacherVo> selectPage(IPage<TeacherVo> page, TeacherSearch teacher);

    /***
     * 管理端新增、修改老师信息
     * @author liweifan
     * @param: teacherSubmitReq
     * @updateTime 2022/3/23 14:30
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.lang.Boolean>
     */
    HttpResponseResult<Boolean> submit(TeacherSubmitReq teacherSubmitReq);

    /***
     * 查询老师首页统计信息
     * @author liweifan
     * @param: userId
     * @updateTime 2022/3/28 16:49
     * @return: com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo
     */
    HttpResponseResult<TeacherHomeVo> queryUserInfo(Long userId);

    /***
     * 开通直播
     * @author liweifan
     * @param: setReq
     * @param: id
     * @updateTime 2022/3/22 11:04
     */
    HttpResponseResult<Boolean> openLive(Long id);

    /**
     * @param userId
     * @return com.yonge.cooleshow.common.entity.HttpResponseResult<java.util.List < com.yonge.cooleshow.biz.dal.entity.Subject>>
     * @description: 获取老师可授课声部列表
     * @author zx
     * @date 2022/3/25 09:37
     */
    List<Subject> querySubject(Long userId);

    /***
     * 设置声部
     * @author liweifan
     * @param: id
     * @param: toLongList
     * @updateTime 2022/4/7 9:56
     * @return: java.lang.Integer
     */
    Integer setSubject(Long id, String subjectIds);

    /***
     * 查询教师基本信息
     * @author liweifan
     * @param: studentId
     * @param: teacherId
     * @updateTime 2022/4/26 17:03
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo>
     */
    HttpResponseResult<TeacherHomeVo> queryTeacherHome(Long studentId, Long teacherId);

    /***
     * 保存老师风采信息
     * @author liweifan
     * @param: teacherDto
     * @updateTime 2022/4/8 14:21
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<com.yonge.cooleshow.biz.dal.vo.TeacherVo>
     */
    HttpResponseResult<TeacherVo> saveTeacherStyle(TeacherDto teacherDto);
    
    /**
     * 修改老师风采
     * @param userId
     * @param styleVideo
     * @param message
     * @return
     */
    boolean updateStyleVideo(Long userId, List<TeacherStyleVideo> styleVideo, String message);

    /***
     * 增加主页浏览量
     * @author liweifan
     * @param: userId
     * @updateTime 2022/4/24 17:45
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.lang.Boolean>
     */
    HttpResponseResult<Boolean> addHomeBrowse(Long userId);
    /***
     * 获取声部下拉框
     * @author liweifan
     * @param: id
     * @updateTime 2022/5/9 10:16
     * @return: java.util.List<com.yonge.cooleshow.biz.dal.entity.Subject>
     */
    List<Subject> querySubjectItem(Long id,String type);

    /**
     * 我的粉丝
     * @param page
     * @param teacherId
     * @return
     */
    IPage<MyFens> queryMyFans(IPage<MyFens> page, Long teacherId);

    /**
     * 老师粉丝查询
     * @param page IPage<MyFens>
     * @param query TeacherQueryInfo.FansQuery
     * @return IPage<MyFens>
     */
    IPage<MyFens> queryMyFans(IPage<MyFens> page, TeacherQueryInfo.FansQuery query);

    /**
     * 设置老师标签
     *
     * @param userId 老师id
     * @param teacherTagEnum 标签
     */
    void setTeacherTag(Long userId, TeacherTagEnum teacherTagEnum);
    
    /**
     * 查询热门老师 
     * 按照老师粉丝数按降序排列，且标记老师是否真正临时直播
     * @return
     */
    List<HotTeacherVo> queryHotTeacherList(Long userId);

    /**
     * 老师详情信息
     * @param teacherId 用户ID
     * @return TeacherVo
     */
    TeacherVo findTeacherDetailInfo(Long teacherId);

    /**
     * 老师统计指标信息
     * @param userId 用户ID
     * @return TeacherWrapper.TeacherStatInfo
     */
    TeacherWrapper.TeacherStatInfo findTeacherStatInfoById(Long userId);
}