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

import com.yuchen.saas.parking.api.dto.PmgBatVehicleFlowQueryDTO;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import com.yuchen.saas.parking.api.vo.*;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class PmgBatStatisticCarDataClientFallback implements FallbackFactory<PmgBatStatisticCarDataClient> {

    @Override
    public PmgBatStatisticCarDataClient create(Throwable throwable) {
        return new PmgBatStatisticCarDataClient() {
            @Override
            public R<PmgBatVehicleFlowVO> getParkVehicleFlow(PmgBatVehicleFlowQueryDTO queryDTO) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatVehicleTypeVO> getParkVehicleType(Long parkId, String beginTime, String endTime) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Map<String, Object>> getDeptInfo(Long deptId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<ParkingPaymentInfoVO> getParkingPaymentInfo(Long deptId, Long parkingId, String beginTime, String endTime) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<ParkingIncomeTrendVO> getParkingIncomeTrend(Long deptId, Long parkingId, Integer statistType, String beginTime, String endTime) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<ParkingInfoVO> getParkingInfo(Long parkingId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
