package jnpf.attendance.fallback;

import jnpf.attendance.AttendanceSimulateDataApi;
import jnpf.attendance.FtbClockInApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 打卡api fallback
 *
 * @author yanwenfu
 * @create 2023-12-04
 */
@Slf4j
@Component
public class AttendanceSimulateDataApiFallback implements FallbackFactory<AttendanceSimulateDataApi> {

    @Override
    public AttendanceSimulateDataApi create(Throwable cause) {
        cause.printStackTrace();
        return new AttendanceSimulateDataApi() {

            @Override
            public void clockIn(String tenantId) throws Exception {
                log.error("调用模拟打卡失败...");
            }
        };
    }
}
