package com.yida.data.user.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.user.EduStaff;
import com.yida.data.common.core.entity.user.EduTeacherDept;
import com.yida.data.user.feign.RemoteTeacherService;
import com.yida.data.user.vo.TeacherCourseInfoVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;
import java.util.Map;

/**
 * RemoteTeacherService fallback处理类
 *
 * @author ZYJ
 * @date 2022/8/26
 */
@Slf4j
@Fallback
public class RemoteTeacherServiceFallback implements FallbackFactory<RemoteTeacherService> {

    @Override
    public RemoteTeacherService create(Throwable throwable) {
        log.error("RemoteTeacherService fallback reason:{}", throwable.getMessage());

        return new RemoteTeacherService() {
            /**
             * 更新教师信息
             */
            @Override
            public ResultBean dealWxTeacherChange(Long schoolId, Long campusId, Long sectionId, Long gradeId, Long classId, List<Map> teacherList, Long deptWxId) {
                return null;
            }

            /**
             * 根据教师微信id查询教师信息
             *
             * @param wxId
             * @param schoolId
             */
            @Override
            public ResultBean<EduStaff> getTeacherByWx(String wxId, Long schoolId) {
                return null;
            }

            /**
             * 根据手机号查询教师
             *
             * @param mobile
             * @param schoolId
             */
            @Override
            public ResultBean<EduStaff> getTeacherByMobileAndSchool(String mobile, Long schoolId) {
                return null;
            }

            /**
             * 根据学校和微信更新或新增教师
             *
             * @param eduStaff
             */
            @Override
            public ResultBean saveStaffBySchoolAndWx(EduStaff eduStaff) {
                return null;
            }

            /**
             * 根据家长手机号、学校查询学生班级的老师
             *
             * @param parentId
             * @param teacherName
             */
            @Override
            public ResultBean<List<EduStaff>> listTeacherByParent(Long parentId, String teacherName) {
                return null;
            }

            @Override
            public ResultBean<List<EduStaff>> listTeacherBySchool(Long schoolId, String name) {
                return null;
            }

            /**
             * 保存易达appId
             *
             * @param staffId
             * @param yidaAppUserId
             */
            @Override
            public ResultBean saveYidaAppUserId(Long staffId, String yidaAppUserId) {
                return null;
            }

            /**
             * 按年级或者班级查询教师任课信息
             *
             * @param gradeId
             * @param classId
             */
            @Override
            public ResultBean<List<TeacherCourseInfoVO>> listTeacherCourseByGrade(Long gradeId, Long classId) {
                return null;
            }

            /**
             * 根据班级和名称查询教师
             *
             * @param classId
             * @param name
             */
            @Override
            public ResultBean<List<EduStaff>> listTeacherByClassAndName(Long classId, String name) {
                return null;
            }

            /**
             * 查询教师对应部门
             *
             * @param teacherId
             * @return
             */
            @Override
            public ResultBean<List<EduTeacherDept>> listTeacherDeptByTeacher(Long teacherId) {
                return null;
            }

            /**
             * 根据家校部门id和类型查询对应教师信息
             *
             * @param deptId 家校部门id
             * @param type   教师类型 1表示校区负责人，2表示年级负责人，3表示班主任，4表示任课老师，5表示学段负责人
             * @return com.yida.data.common.core.common.ResultBean<java.util.List < com.yida.data.common.core.entity.user.EduStaff>>
             * @author ZYJ
             * @date 2022/7/15 17:48
             */
            @Override
            public ResultBean<List<EduStaff>> listTeacherByDeptId(Long deptId, String type) {
                return null;
            }
        };
    }
}
