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

import com.yuchen.saas.integration.feign.api.util.SaasIntegrationFeignFallbackUtils;
import com.yuchen.saas.integration.hik.isc.dto.CameraDeviceAddDTO;
import com.yuchen.saas.integration.hik.isc.dto.CameraDeviceDeleteDTO;
import com.yuchen.saas.integration.hik.isc.dto.CameraDeviceUpdateDTO;
import com.yuchen.saas.integration.hik.isc.vo.CameraDeviceInfoVO;
import com.yuchen.saas.integration.hik.isc.vo.XgVideoVO;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class PmgBatCameraDeviceInfoFeignFallback implements FallbackFactory<PmgBatCameraDeviceInfoFeign> {

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

            @Override
            public R<Boolean> add(List<CameraDeviceAddDTO> dto) {
                return SaasIntegrationFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> update(CameraDeviceUpdateDTO dto) {
                return SaasIntegrationFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> delete(CameraDeviceDeleteDTO dto) {
                return SaasIntegrationFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<CameraDeviceInfoVO> info(Long id) {
                return SaasIntegrationFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<XgVideoVO> getVideoUrl(Long id) {
                return SaasIntegrationFeignFallbackUtils.printLogAndReturn(throwable);
            }


        };
    }

}
