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

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

/**
 * @Description : 通用微服务
 * @Reference :
 * @Author : junsheng.li
 * @CreateDate 2023/4/18 10:20
 * @Modify:
 **/
@Component
public class IQmsCommonFallbackFactory extends BaseFallBackBean implements FallbackFactory<IQmsCommonCloud> {
    @Override
    public IQmsCommonCloud create(Throwable cause) {
        return new IQmsCommonCloud() {
            @Override
            public BaseResultBean findPointSampleLedgerFomMes(String organizeCode, String proLineCode) {
                return makeBaseFallBack("微服调用出错", cause);
            }

            @Override
            public BaseResultBean isExistClass(String packageName, String className) {
                return makeBaseFallBack("微服调用出错",cause);
            }

            @Override
            public BaseResultBean<Class<?>> getClassInfo(String packageName, String className) {
                return makeBaseFallBack("微服调用出错",cause);
            }

            @Override
            public BaseResultBean getSysEnum(String packageName, String className, String enumName, CommonEnumUtil.SOFT_TYPE softType) {
                return makeBaseFallBack("微服调用出错",cause);
            }
        };
    }
}
