package com.yida.data.attendance.fallback;

import com.yida.data.attendance.feign.RemoteAttendanceResultService;
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;

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

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

        return new RemoteAttendanceResultService() {

            @Override
            public ResultBean initAttendanceResult() {
                return null;
            }

            @Override
            public ResultBean attendanceNotice() {
                return null;
            }
        };
    }
}
