package com.yida.data.attendance.fallback;

import com.yida.data.attendance.dto.IssuedFaceDTO;
import com.yida.data.attendance.dto.RemoveFaceDTO;
import com.yida.data.attendance.feign.RemoteAttendanceDeviceService;
import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.attendance.EduAttendanceDevice;
import com.yida.data.common.core.entity.attendance.EduAttendanceDeviceGroup;
import feign.hystrix.FallbackFactory;
import java.util.List;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteAttendanceDeviceService() {
            @Override
            public ResultBean<List<EduAttendanceDevice>> listDeviceBySchool(Long schoolId) {
                return null;
            }

            @Override
            public ResultBean<List<EduAttendanceDevice>> listDeviceByType(String type) {
                return null;
            }

            /**
             * 下发人脸到设备
             *
             * @param dto
             */
            @Override
            public ResultBean issuedFace(IssuedFaceDTO dto) {
                return null;
            }

            /**
             * 删除设备中的人脸
             *
             * @param dto
             */
            @Override
            public ResultBean removeFace(RemoveFaceDTO dto) {
                return null;
            }

            /**
             * 查询设备组中的设备
             *
             * @param groupIds
             */
            @Override
            public ResultBean<List<EduAttendanceDevice>> listDeviceByGroup(Long[] groupIds) {
                return null;
            }

            /**
             * 根据id查询设备
             *
             * @param ids
             */
            @Override
            public ResultBean<List<EduAttendanceDevice>> listDeviceById(Long[] ids) {
                return null;
            }

            /**
             * 根据id查询设备组
             *
             * @param ids
             * @return
             */
            @Override
            public ResultBean<List<EduAttendanceDeviceGroup>> listDeviceGroupById(Long[] ids) {
                return null;
            }

            /**
             * 更新设备在线状态
             */
            @Override
            public ResultBean updateDeviceStatus() {
                return null;
            }

            /**
             * 校时所有设备
             */
            @Override
            public ResultBean timingAllDevice() {
                return null;
            }
        };
    }
}
