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

import cn.estsh.i3plus.ext.mes.pcn.icloud.sdk.IMesPcnCommonCloud;
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 : yunhao
 * @CreateDate : 2019-04-26 11:11
 * @Modify:
 **/
@Component
public class IMesPcnCommonFallbackFactory extends BaseFallBackBean implements FallbackFactory<IMesPcnCommonCloud> {
    @Override
    public IMesPcnCommonCloud create(Throwable cause) {
        return new IMesPcnCommonCloud() {
            @Override
            public BaseResultBean isExistClass(String packageName, String className) {
                return makeBaseFallBack("微服调用出错", cause);
            }

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

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