package com.yida.data.school.fallback.facility;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.school.EduDormitory;
import com.yida.data.common.core.entity.school.EduDormitoryMaster;
import com.yida.data.common.core.entity.school.EduDormitoryRoom;
import com.yida.data.school.dto.index.EditPersonNumDTO;
import com.yida.data.school.dto.index.ListDormRoomDTO;
import com.yida.data.school.feign.facility.RemoteDormitoryService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

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

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

        return new RemoteDormitoryService() {
            /**
             * 查询宿管管辖的宿舍楼
             *
             * @param masterId
             * @return
             */
            @Override
            public ResultBean<List<EduDormitory>> listDormByMaster(Long masterId) {
                return null;
            }

            /**
             * 查询寝室
             *
             * @param dto
             */
            @Override
            public ResultBean<List<EduDormitoryRoom>> listDormRoom(ListDormRoomDTO dto) {
                return null;
            }

            /**
             * 查询寝室
             *
             * @param id
             * @return
             */
            @Override
            public ResultBean<EduDormitoryRoom> getDormRoom(Long id) {
                return null;
            }

            /**
             * 查询寝室
             *
             * @param id
             * @return
             */
            @Override
            public ResultBean<EduDormitoryRoom> getDormRoomNoPermission(Long id) {
                return null;
            }

            /**
             * 根据名称和宿舍查询
             *
             * @param name
             * @param dormId
             * @return
             */
            @Override
            public ResultBean<EduDormitoryRoom> getDormRoomByNameAndDorm(String name, Long dormId) {
                return null;
            }

            /**
             * 根据名称查询宿舍
             *
             * @param name
             * @param schoolId
             * @return
             */
            @Override
            public ResultBean<EduDormitory> getDormByName(String name, Long schoolId) {
                return null;
            }

            /**
             * 修改寝室入住的人数
             *
             * @param dtos
             * @return
             */
            @Override
            public ResultBean editPersonNum(List<EditPersonNumDTO> dtos) {
                return null;
            }

            @Override
            public ResultBean editPersonNumNoPermission(List<EditPersonNumDTO> dtos) {
                return null;
            }

            /**
             * 获取宿舍
             *
             * @param id
             * @return
             */
            @Override
            public ResultBean<EduDormitory> getDorm(Long id) {
                return null;
            }

            /**
             * 获取宿舍信息(不鉴权)
             *
             * @param id 宿舍id
             * @return com.yida.data.common.core.common.ResultBean<com.yida.data.common.core.entity.school.EduDormitory>
             * @author ZYJ
             * @date 2022/7/15 15:20
             */
            @Override
            public ResultBean<EduDormitory> getDormNoPermission(Long id) {
                return null;
            }

            @Override
            public ResultBean<List<EduDormitory>> getDormBySchoolId(Long schoolId) {
                return null;
            }

            @Override
            public ResultBean<List<EduDormitoryRoom>> listDormRoomNoAuth(ListDormRoomDTO dto) {
                return null;
            }
        };
    }
}
