package cn.ey.biz.module.weaver.api;

import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
import cn.ey.biz.module.weaver.common.Constants;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;

/**
 * 工时 获取流程图数据
 *
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface GetSimpleModeDataService {

    @RequestMapping(method= RequestMethod.POST, value="/api/workflow/layout/getSimpleModeData",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    SimpleModeDataResponse getSimpleModeData(@RequestBody SimpleModeDataRequest request);

    @Data
    class SimpleModeDataRequest{
        String requestId;
        String requestType;
        String workflowid;
    }

    @Data
    class SimpleModeDataResponse{
        ForecastInfoResponse forecastInfo;
        String forecastLinkColor;
        String  passedLinkColor;
        List<NodeInfoResponse> nodeInfo;
    }

    @Data
    class ForecastInfoResponse  {
        String  forecastNodeName;
        String  forecastUserName;
        String  forecastTime;
        String  forecastNode;
        String  forecastUser;
        boolean  isEnd;
        String  forecastDate;
    }

    @Data
    class NodeInfoResponse{
        String  nodeName;
        String  nodeOperatorName;
        String  nodeOperatorNameStr;
        String  branchNumber;
        String[]  branchStartNodeId;
        String  operateTime;
        String  currentBranch;
        String  ntype;
        String  nodeType;
        String  operator;
        String  nodeattribute;
        String  nodeColor;
        String  nodeRemark;
        String  strokeColor;
        String  nodeid;
        String  operateDate;
    }

}
