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

import com.yuchen.saas.park.api.dto.fire.inspect.FireInspectTypeReqDTO;
import com.yuchen.saas.park.api.dto.fire.inspect.client.FireInspectLogReqDTO;
import com.yuchen.saas.park.api.dto.fire.inspect.client.OperateTaskReqDTO;
import com.yuchen.saas.park.api.dto.fire.inspect.client.ProcessTaskReqDTO;
import com.yuchen.saas.park.api.dto.fire.inspect.client.SubmitTaskReqDTO;
import com.yuchen.saas.park.api.dto.fire.inspect.plan.FireInspectPlanReqDTO;
import com.yuchen.saas.park.api.dto.fire.inspect.plan.FireInspectPlanTaskReqDTO;
import com.yuchen.saas.park.api.util.SaasParkFeignFallbackUtils;
import com.yuchen.saas.park.api.vo.fire.inspect.FireInspectTypeVO;
import com.yuchen.saas.park.api.vo.fire.inspect.plan.*;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.mp.support.NestPage;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author zhouhanwei
 * @create 2024/4/9 16:17
 */
@Component
public class ClientPlanTaskFallback implements FallbackFactory<ClientPlanTaskFeign> {

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

            @Override
            public R<List<FireInspectTypeVO>> getClientInspectTypeList(FireInspectTypeReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<FireInspectPlanVO>> findClientPlanPage(FireInspectPlanReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<FireInspectPlanTaskVO>> findClientPlanTaskPage(FireInspectPlanTaskReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<SaasParkFireInspectLogVO>> findClientPlanTaskLogList(FireInspectLogReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<FireInspectPlanDetailVO> getAdminPlanDetail(Long planId) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<FireInspectPlanTaskDetailVO> getClientPlanTaskDetail(Long planTaskId) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<FireInspectPlanConfigDetailVO> getClientPlanConfigDetail(Long planConfigId) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R operateTask(OperateTaskReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R startProcessTask(ProcessTaskReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R submitTask(SubmitTaskReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R editConfigTask(SubmitTaskReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R completeProcessTask(ProcessTaskReqDTO reqDTO) {
                return SaasParkFeignFallbackUtils.printLogAndReturn(throwable);
            }

        };
    }
}
