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

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

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

        return new RemoteManuscriptService() {
            @Override
            public ResultBean publishManuscript(Long id) {
                return null;
            }
        };
    }
}
