package com.yuchen.saas.device.api.feign;

import com.yuchen.saas.device.api.dto.irrigate.SaasHandleAutoIrrigationDTO;
import com.yuchen.saas.device.api.utils.SaasDeviceFeignFallbackUtils;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;


@Component
public class IrrigateFeignFallback implements FallbackFactory<IrrigateFeign> {

    @Override
    public IrrigateFeign create(Throwable throwable) {
        return new IrrigateFeign() {
            @Override
            public R<Boolean> handleAutoIrrigation(SaasHandleAutoIrrigationDTO handleAutoIrrigationDTO) {
                return SaasDeviceFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };

    }


}
