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

import cn.estsh.i3plus.ext.mes.pcn.icloud.sdk.IMesPcnBaseDataSyncCloud;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.pojo.base.bean.BaseFallBackBean;
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @Description :
 * @Reference :
 * @Author : yiming.gu
 * @CreateDate : 2019-04-24 15:40
 * @Modify:
 **/
@Component
public class MesPcnBaseDataSyncFactory extends BaseFallBackBean implements FallbackFactory<IMesPcnBaseDataSyncCloud> {

    private static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);

    @Override
    public IMesPcnBaseDataSyncCloud create(Throwable cause) {
        return new IMesPcnBaseDataSyncCloud() {
            @Override
            public BaseResultBean getUser() {
                return makeBaseFallBack("微服调用出错", cause);
            }
        };
    }
}
