package com.jeeplus.flowable.factory;

import com.jeeplus.flowable.feign.IFlowableApi;
import com.jeeplus.mail.feign.IMailApi;
import com.jeeplus.sys.service.dto.UserDTO;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.FlowNode;
//import org.flowable.task.api.Task;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * 流程服务降级处理
 */
@Slf4j
@Component
public class FlowableApiFallbackFactory implements FallbackFactory <IFlowableApi> {

    @Override
    public IFlowableApi create(Throwable throwable) {
        log.error ( "流程服务调用失败:{}", throwable.getMessage ( ) );
        return new IFlowableApi() {

            @Override
            public Map historicTaskList3(String procInsId) {
                return null;
            }

            @Override
            public Map historicTaskList2(String procInsId) {
                return null;
            }

            @Override
            public Map getByNameForFen(String name) {
                return null;
            }

            @Override
            public String startForFen(Map<String, String> map) {
                return null;
            }

            @Override
            public Map<String ,String > startForFenNew(Map<String, Map<String, String>> map) {
                return null;
            }

            @Override
            public String updateAssignee(Map<String, String> map) {
                return null;
            }

            @Override
            public void insertMyNotice(Map<String, String> map) {

            }

            @Override
            public void updateMyNotice(Map<String, String> map) {

            }

            @Override
            public void updateTitleMyNotice2(Map<String, String> map) {

            }

            @Override
            public String getRepetitionCountBymyNoticeTitle(Map<String, String> map) {
                return null;
            }

            @Override
            public String getCountBymyNoticeTitle(Map<String, String> map) {
                return null;
            }

            @Override
            public String add(Map<String, String> map) {
                return null;
            }

            @Override
            public String taskDispose(Map<String, String> map) {
                return null;
            }

            @Override
            public FlowNode getCurrentTask(String processInstanceId) {
                return null;
            }

            @Override
            public String getTaskIdByprocInstId(String procInsId) {
                return null;
            }

            @Override
            public List<String> getTaskAuditUsers(String taskId) {
                return null;
            }

            @GetMapping("/flowable/task/getCurrentTaskName")
            @Override
            public String getCurrentTaskName(String processInstanceId) {
                return null;
            }

            @Override
            public void auditByProcInsIdAndFlag(String procInsId, String flag, String assignee, String comm) {

            }

            @Override
            public boolean checkIsLastTask(String procInsId) {
                return false;
            }

            @Override
            public void revokeProcIns(String procInsId) {

            }
        };
    }
}
