package com.yuchen.saas.parking.charge.api.feign;

import com.yuchen.saas.parking.charge.api.dto.charge.SpcTerminalDeviceTagDTO;
import com.yuchen.saas.parking.charge.api.util.ParkChargingFeignFallbackUtils;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;


@Component
public class SpcChargeTerminalFeignClientFallback implements FallbackFactory<SpcChargeTerminalFeignClient> {
    @Override
    public SpcChargeTerminalFeignClient create(Throwable throwable) {
        return new SpcChargeTerminalFeignClient() {
            @Override
            public R<Boolean> updateTerminalDeviceTags(SpcTerminalDeviceTagDTO terminalDeviceTagDTO) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
