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

import java.util.List;

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

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

        return new RemoteUserDeviceService() {
            @Override
            public ResultBean batchSave(List<EduUserDevice> list) {
                return null;
            }

            @Override
            public ResultBean<List<EduUserDevice>> listUserDevice(Long userId, Integer type, Long deviceId, Long faceGroupId) {
                return null;
            }

            @Override
            public ResultBean<String> deleteRelation(EduUserDevice userDevice) {
                return null;
            }
        };
    }
}
