package com.yida.data.device.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.device.feign.studentCard.RemoteStudentCardService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteStudentCardService() {
            /**
             * 更新设备定位
             *
             * @return
             */
            @Override
            public ResultBean updateCardPos() {
                return null;
            }

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