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

import cn.estsh.i3plus.ext.mes.icloud.sdk.IWmsBomTakeEffectCloud;
import cn.estsh.i3plus.ext.mes.pojo.model.WmsBomTotalModel;
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;

import java.util.List;

/**
 * 文件描述
 *
 * @author xiangming.liao
 * @date 2021年03月27日 16:49
 */
@Component
public class WmsBomTakeEffectFallbackFactory extends BaseFallBackBean implements FallbackFactory<IWmsBomTakeEffectCloud> {
    @Override
    public IWmsBomTakeEffectCloud create(Throwable throwable) {
        return new IWmsBomTakeEffectCloud() {
            @Override
            public BaseResultBean getBomTotalByPartNo(String partNo, String organizeCode) {
                return makeBaseFallBack("微服调用出错", throwable);
            }

            /*@Override
            public BaseResultBean doEffect(List<WmsBomTotalModel> wmsBomTotalModels) {
                return makeBaseFallBack("微服调用出错", throwable);
            }*/
            @Override
            public BaseResultBean doEffect(String partNo, String organizeCode) {
                return makeBaseFallBack("微服调用出错", throwable);
            }
        };
    }
}
