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 com.yuchen.saas.park.api.vo.work.SaasWorkOrderAutoDispatchVo;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

@Component
public class WorkOrderAutoDispatchFeignServiceFallback implements FallbackFactory<WorkOrderAutoDispatchFeignService> {
    @Override
    public WorkOrderAutoDispatchFeignService create(Throwable throwable) {
        return new WorkOrderAutoDispatchFeignService(){

            @Override
            public R<SaasWorkOrderAutoDispatchVo> getAutoDispatchUsers(Long repairTypeId) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> getIsOpenAutoDispatch(Integer workOrderCategory, Long customerId) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }


        };
    }
}
