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

import com.yuchen.saas.parking.api.entity.PmgBatManagePassRule;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;


@Component
public class PmgBatManagePassRuleClientFallback implements FallbackFactory<PmgBatManagePassRuleClient> {

    @Override
    public PmgBatManagePassRuleClient create(Throwable throwable) {
        return new PmgBatManagePassRuleClient() {

            @Override
            public R<PmgBatManagePassRule> getManageProtocolDetail(String tenantId, Long parkId, String protocolType) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

        };
    }
}
