package jnpf.attendance.fallback;

import jnpf.attendance.AttendanceApi;
import jnpf.model.attendance.vo.attendance.AttendanceToThousandsFacesVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * describe
 *
 * @author HuangLinPan
 * @date 2023/11/27
 */

@Slf4j
@Component
public class AttendanceApiFallback implements FallbackFactory<AttendanceApi> {

    @Override
    public AttendanceApi create(Throwable cause) {
        cause.printStackTrace();
        return new AttendanceApi() {
            @Override
            public Boolean invalidationCoupons(String tenantId) {
                log.error("定时失效考勤劵失败...");
                return Boolean.FALSE;
            }

//            @Override
//            public Boolean overtimeVouchers(String tenantId) {
//                log.error("定时发放加班劵失败...");
//                return null;
//            }

            @Override
            public Boolean storageRest(String tenantId) {
                log.error("每月定时计算用户存休失败...");
                return null;
            }

            @Override
            public AttendanceToThousandsFacesVo attendanceToThousandsFaces() {
                log.error("每月定时计算用户存休失败...");
                return null;
            }


        };
    }
}
