package com.yida.data.attendance.fallback;

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

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

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

        return new RemoteAttendanceRuleService() {
            /**
             * 更新规则状态
             *
             * @return
             */
            @Override
            public ResultBean updateRuleStatus() {
                return null;
            }

            /**
             * 提醒打卡
             */
            @Override
            public ResultBean remindStaff() {
                return null;
            }

            /**
             * 处理记录到结果表
             */
            @Override
            public ResultBean staffRecord() {
                return null;
            }
        };
    }
}
