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

import cn.estsh.i3plus.ext.mes.icloud.sdk.IQmsReworkRangeCloud;
import cn.estsh.i3plus.ext.mes.pojo.model.bu3.SxInsertReworkRangeModel;
import cn.estsh.i3plus.ext.mes.pojo.model.bu3.SxReworkRangeModel;
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;

/**
 * @PROJECT_NAME: i3plus-mes-panasonic-dev
 * @DESCRIPTION:
 * @USER: xinwang.yi
 * @DATE: 2023-06-30 10:39
 */
@Component
public class IQmsReworkRangeFactory extends BaseFallBackBean implements FallbackFactory<IQmsReworkRangeCloud> {
    @Override
    public IQmsReworkRangeCloud create(Throwable throwable) {
        return new IQmsReworkRangeCloud() {
            @Override
            public BaseResultBean updateReworkRangeValidByIdsWithMes(Long[] ids, Integer status, String userName) {
                return makeBaseFallBack("微服调用出错", throwable);
            }

            @Override
            public BaseResultBean queryReworkRangeListByPager(SxReworkRangeModel reworkRangeModel) {
                return makeBaseFallBack("微服调用出错", throwable);
            }

            @Override
            public BaseResultBean insertSxQmsReworkRangeWithMes(SxInsertReworkRangeModel sxInsertReworkRangeModel) {
                return makeBaseFallBack("微服调用出错", throwable);
            }

            @Override
            public BaseResultBean unbindReworkRangeList(String workOrderNo, List<String> serialNumberList, String organizeCode, String userName) {
                return makeBaseFallBack("微服调用出错", throwable);
            }
        };
    }
}
