package jnpf.attendance.fallback;

import jnpf.attendance.AttendanceConfirmApi;
import jnpf.base.ActionResult;
import jnpf.model.thousandsfaces.TodayWorkVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class AttendanceConfirmApiFallback implements FallbackFactory<AttendanceConfirmApi> {

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

            @Override
            public ActionResult<Boolean> autoCreateConfirm() {
                return null;
            }

            @Override
            public  ActionResult<Boolean> confirmAutoSlippage() {
                return null;
            }

            @Override
            public List<TodayWorkVo> getTodayWorkConfirmList() {
                return List.of();
            }
        };
    }
}
