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.dto.news.SysNoticeSaveDTO;
import com.yida.data.school.feign.news.RemoteNoticeSystemService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteNoticeSystemService() {
            /**
             * 发送系统通知
             *
             * @param dto
             */
            @Override
            public ResultBean<String> sendNotice(SysNoticeSaveDTO dto) {
                return null;
            }
        };
    }
}
