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.EduStaffDept;
import com.yida.data.common.core.entity.user.EduTeacherDept;
import com.yida.data.user.dto.ListStaffDTO;
import com.yida.data.user.feign.RemoteStaffService;
import com.yida.data.user.vo.TeacherClassVO;
import com.yida.data.user.vo.TeacherDeptVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

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

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

        return new RemoteStaffService() {
            /**
             * 根据教师id查询教师角色
             *
             * @param teacherId 教师id
             * @param type
             * @return
             */
            @Override
            public ResultBean<List<EduTeacherDept>> findTeacherRole(Long teacherId, Integer type) {
                return null;
            }

            /**
             * 查询教师可见课程
             *
             * @param teacherId
             * @param schoolId
             * @return
             */
            @Override
            public ResultBean<List<Long>> findTeacherCourseId(Long teacherId, Long schoolId) {
                return null;
            }

            /**
             * 根据id查询职工信息
             *
             * @param id
             */
            @Override
            public ResultBean<EduStaff> getStaffNoPermission(Long id) {
                return null;
            }

            /**
             * 通过部门id，名字或者手机号查询员工id
             *
             * @param deptId
             * @param nameOrPhone
             * @param schoolId
             * @return
             */
            @Override
            public ResultBean<List<Long>> listStaffByDeptId(Long deptId, String nameOrPhone, Long schoolId) {
                return null;
            }

            @Override
            public ResultBean<List<Long>> listStaffByDeptIdNoPermission(Long deptId, String nameOrPhone, Long schoolId) {
                return null;
            }

            /**
             * 根据条件查询职工列表
             *
             * @param dto
             */
            @Override
            public ResultBean<List<EduStaff>> listStaff(ListStaffDTO dto) {
                return null;
            }

            /**
             * 查询职工信息
             *
             * @param id
             */
            @Override
            public ResultBean<EduStaff> getStaff(Long id) {
                return null;
            }

            /**
             * 查询职工部门信息
             *
             * @param staffIds
             * @return
             */
            @Override
            public ResultBean<List<EduStaffDept>> getStaffDeptByStaffIds(List<Long> staffIds) {
                return null;
            }

            @Override
            public ResultBean<List<EduStaffDept>> getStaffDeptByStaffIdsNoPermission(List<Long> staffIds) {
                return null;
            }

            @Override
            public ResultBean syncQywxStaff() {
                return null;
            }

            /**
             * 初始化职工信息
             *
             * @param teacherList
             */
            @Override
            public ResultBean initStaff(List<EduStaff> teacherList) {
                return null;
            }

            /**
             * 根据职工微信id查询职工信息
             *
             * @param wxId
             * @param mobile
             * @param wxOpenId
             * @param schoolId
             */
            @Override
            public ResultBean<EduStaff> getStaffByWxOrMobileOrOpenId(String wxId, String mobile, String wxOpenId, Long schoolId) {
                return null;
            }

            /**
             * 处理企业微信职工删除
             *
             * @param wxId
             * @param schoolId
             */
            @Override
            public ResultBean dealWxUserDelete(String wxId, Long schoolId) {
                return null;
            }

            @Override
            public ResultBean<EduStaff> getStaffByDahuaNoPermission(String dahuaCode) {
                return null;
            }

            /**
             * 查询教师可见班级
             *
             * @param teacherId
             * @return
             */
            @Override
            public ResultBean<List<TeacherClassVO>> listClassByTeacher(Long teacherId) {
                return null;
            }

            /**
             * 保存职工openId
             *
             * @param staffId 职工id
             * @param openId  微信openId
             * @return com.yida.data.common.core.common.ResultBean
             * @author ZYJ
             * @date 2022/9/22 16:17
             */
            @Override
            public ResultBean saveWxPublicOpenId(Long staffId, String openId) {
                return null;
            }

            @Override
            public ResultBean<List<Integer>> listStaffRolesByStaffId(Long staffId) {
                return null;
            }

            @Override
            public ResultBean<List<EduStaff>> getStaffList(List<Long> staffIds) {
                return null;
            }

            @Override
            public ResultBean updateStaffCache() {
                return null;
            }

            @Override
            public ResultBean<List<Long>> listClassIdByStaffId() {
                return null;
            }
        };
    }
}
