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.RemoteNoticeUpdateService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteNoticeUpdateService() {
            /**
             * 定时发送购买通知
             *
             * @param noticeId
             * @return
             */
            @Override
            public ResultBean updateBuyNoticeById(Long noticeId) {
                return null;
            }
        };
    }
}
