package com.jeeplus.flowable.factory;

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

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

            }

            @Override
            public String getReimbursementCreateUserIdByProcessInstanceId(String id) {
                return "";
            }
        };
    }
}
