package com.jeeplus.sys.factory;

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

/**
 * 会计服务降级处理
 *
 * @author jeeplus
 */
@Slf4j
@Component
public class CwProjectReportApiFallbackFactory implements FallbackFactory <ICwProjectReportApi> {
    @Override
    public ICwProjectReportApi create(Throwable throwable) {
        log.error ( "会计服务调用失败:{}", throwable.getMessage ( ) );
        throwable.printStackTrace ( );
        return new ICwProjectReportApi( ) {

            @Override
            public String getReportReviewUserIdByProcInsId(String procInsId, String userId) {
                return "";
            }
        };
    }
}
