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

import com.yuchen.saas.park.api.entity.property.PropertyFeeMode;
import com.yuchen.saas.park.api.entity.property.PropertyHouses;
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 PropertyFeeModeFeignServiceFallback implements FallbackFactory<PropertyFeeModeFeignService> {

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

            @Override
            public R save(PropertyHouses propertyHouses) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PropertyFeeMode> detail(Long id) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
