package com.jeeplus.flowable.factory;

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

@Slf4j
@Component
public class PsiManagementApiFallbackFactory implements FallbackFactory<IPsiManagementApi> {

    @Override
    public IPsiManagementApi create(Throwable cause) {
        log.error("psi-management service call failed:{}", cause.getMessage());
        return new IPsiManagementApi() {
            @Override
            public void nearExpiryList() {
            }
        };
    }
}
