package com.zd.system.api.airbottle.factory;

import com.zd.common.core.domain.R;
import com.zd.system.api.airbottle.RemoteAirBottleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteAirBottleFallbackFactory implements FallbackFactory<RemoteAirBottleService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteAirBottleFallbackFactory.class);

    @Override
    public RemoteAirBottleService create(Throwable throwable) {
        log.error("气瓶服务调用失败:{}", throwable.getMessage());
        return (tag) -> R.fail("新增报警记录失败:" + throwable.getMessage());
    }
}
