package com.yida.data.school.fallback.news;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.school.feign.news.RemoteNoticeSchoolService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteNoticeSchoolService() {
            @Override
            public ResultBean sendNotice(Long noticeId) {
                return null;
            }
        };
    }
}
