package com.yida.data.attendance.fallback;

import com.yida.data.attendance.feign.RemoteAttendanceNoticeService;
import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.attendance.EduAttendanceNotice;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteAttendanceNoticeService() {
            @Override
            public ResultBean saveNotice(EduAttendanceNotice notice) {
                return null;
            }
        };
    }
}
