package com.yuchen.saas.park.api.feign.work;

import com.yuchen.saas.park.api.dto.work.SaasWorkOrderDto;
import com.yuchen.saas.park.api.entity.work.SaasWorkOrder;
import com.yuchen.saas.park.api.util.SaasParkFeignFallbackUtils;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

@Component
public class WorkOrderFeignServiceFallback implements FallbackFactory<WorkOrderFeignService> {


    @Override
    public WorkOrderFeignService create(Throwable throwable) {
        return new WorkOrderFeignService(){
            @Override
            public R<SaasWorkOrder> add(SaasWorkOrderDto workOrderDto) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }



}
