package com.jeeplus.flowable.factory;

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

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

            }
        };
    }
}
