package com.njcn.bpm.api;

import com.njcn.bpm.api.fallback.BpmProcessFeignClientFallbackFactory;
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * 流程实例 Api 接口
 *
 * @author hongawen
 */
@FeignClient(value = ServerInfo.BPM,path = "/bpm/processInstance",fallbackFactory = BpmProcessFeignClientFallbackFactory.class)
public interface BpmProcessFeignClient {

    /**
     *
     * @param userId 用户编号
     * @param reqDTO 创建信息
     * @return 实例的编号
     */
    @PostMapping("/createProcessInstance")
    HttpResult<String> createProcessInstance(@RequestParam("userId") String userId, @RequestBody BpmProcessInstanceCreateReqDTO reqDTO);


    @PostMapping("/cancelByStartUser")
    HttpResult<Boolean> cancelProcessInstanceByStartUser(@RequestBody BpmProcessInstanceCancelParam cancelReqVO);


}
