package com.jeeplus.flowable.factory;

import com.jeeplus.flowable.feign.IConsultApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 项目降级处理
 */
@Slf4j
@Component
public class ConsultApiFallbackFactory implements FallbackFactory<IConsultApi> {
    @Override
    public IConsultApi create(Throwable cause) {
        log.error ( "财务服务调用失败:{}", cause.getMessage ( ) );
        return new IConsultApi() {
            @Override
            public void updateOldData() {

            }
        };
    }
}
