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

import cn.ey.biz.module.weaver.common.Constants;
import cn.ey.biz.module.weaver.common.RSP;
import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
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;

/**
 * 流程实例：流程干预（对外）
 *
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface DoIntervenorService {

    @RequestMapping(method= RequestMethod.POST, value="/api/workflow/paService/doIntervenor",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    RSP<DoIntervenorResponse> doIntervenor(@RequestBody DoIntervenorRequest request);

    @Data
    class DoIntervenorRequest{
        boolean enableIntervenor;		//非必填	干预是否执行节点前附加操作	""
        String Intervenorid;		    //必填	干预节点接收人，多个人以","号隔开	""
        String remark;		         //非必填	操作意见	""
        Integer requestId;		//必填	要干预的流程请求Id	""
        Integer SignType;		//非必填	会签类型 0 ：非会签 1：会签 2：依次逐个处理	""
        Integer submitNodeId;		//必填	目标节点ID	""
    }

    @Data
    class DoIntervenorResponse{

    }

}
