package com.yida.data.attendance.fallback;

import com.yida.data.attendance.feign.RemoteUserStrategyService;
import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteUserStrategyService fallback处理类
 */
@Slf4j
@Fallback
public class RemoteUserStrategyServiceFallback implements FallbackFactory<RemoteUserStrategyService> {

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

        return new RemoteUserStrategyService() {

            @Override
            public ResultBean<String> checkOverTimeUserStrategy() {
                return null;
            }
        };
    }
}
