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.EduFaceGroupDevice;
import com.yida.data.common.core.entity.user.EduUserDevice;
import com.yida.data.user.feign.RemoteFaceGroupDeviceService;
import com.yida.data.user.feign.RemoteUserDeviceService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * RemoteFaceGroupDeviceService fallback处理类
 *
 * @author ZYJ
 * @date 2023/9/26
 */
@Slf4j
@Fallback
public class RemoteFaceGroupDeviceServiceFallback implements FallbackFactory<RemoteFaceGroupDeviceService> {

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

        return new RemoteFaceGroupDeviceService() {
            @Override
            public ResultBean<List<Long>> listFaceGroupOnlineDevice(Long faceGroupId) {
                return null;
            }
        };
    }
}
