package com.yeejoin.amos.boot.biz.common.workflow.feign;

import java.util.HashMap;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.alibaba.fastjson.JSONObject;


@FeignClient(name = "AMOS-API-WORKFLOW",path = "workflow", configuration = {CommonMultipartSupportConfig.class})
public interface WorkflowFeignService {
     /**
      * 发起流程
      * @param params
      * @return
      */
	 @RequestMapping(value = "/task/startProcess", method = RequestMethod.POST)
	 JSONObject 	startByVariable(@RequestBody Object params) ;
	 /**
	  * 完成任务
	  * @param taskID
	  * @param variable
	  * @return
	  * @throws Exception
	  */
	 @RequestMapping(value = "/task/pickupAndCompleteTask/{taskId}", method = RequestMethod.POST)
	 JSONObject  pickupAndCompleteTask(@PathVariable("taskId") String taskID, @RequestBody(required = false) HashMap<String, Object> variable) throws Exception;
	/**
	 * 查询当前流程下所有的可执行任务
	 * @param processInstanceId
	 * @return
	 */
	 @RequestMapping(value = "/task/list/all/{processInstanceId}", method = RequestMethod.GET)
	 JSONObject  getTaskList(@PathVariable("processInstanceId") String processInstanceId) ;
	 
	 
	 
}
