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

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.entity.notice.EduNoticeSystemUser;
import com.yida.data.school.feign.news.RemoteNoticeSystemUserService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteNoticeSystemUserService() {
            /**
             * 新增通知关联用户
             *
             * @param eduNoticeSystemUser
             */
            @Override
            public Long insertNotice(EduNoticeSystemUser eduNoticeSystemUser) {
                return null;
            }
        };
    }
}
