package cn.estsh.i3plus.ext.mes.icloud.sdkfallback;

import cn.estsh.i3plus.ext.mes.icloud.sdk.IWmsStockSnCloud;
import cn.estsh.i3plus.pojo.base.bean.BaseFallBackBean;
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class WmsStockSnFallbackFactory extends BaseFallBackBean implements FallbackFactory<IWmsStockSnCloud> {
    @Override
    public IWmsStockSnCloud create(Throwable throwable) {
        return new IWmsStockSnCloud() {
            @Override
            public BaseResultBean getPartNoBySn(String sn, String organizeCode) {
                return makeBaseFallBack("微服调用出错", throwable);
            }
        };
    }
}
