BpmModelFeignClient.java 3.65 KB
package com.hotent.Feign;

import com.hotent.Feign.exception.BpmModelFeignFallBackException;
import com.hotent.entity.CommonResult;
import com.hotent.vo.BpmVariableDefVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Optional;

/**
 * @Author: Cola
 * @Date: 2021/08/20/10:49
 * @Description: eip-bpm-model远程接口
 **/

@FeignClient(name="${eip.feignClient.bpmModel:eip-bpm-model}",contextId = "api-manager-eip-bpm-model",fallbackFactory = BpmModelFeignFallBackException.class)
public interface BpmModelFeignClient {

    /**
     * 根据用户ID和流程ID判断是否有启动权限
     * @param userId 用户ID
     * @param defId 流程定义ID
     * @param leadId 领导id
     * @param instId 实例id
     * @return 根据用户ID和流程ID判断是否有启动权限
     * @throws Exception
     */
    @RequestMapping(value = "/${openApi.prefix}/flow/defAuthorize/v1/startRight", method = RequestMethod.GET , produces = { "application/json; charset=utf-8" })
    public CommonResult<Boolean> startRight(@RequestParam(value = "userId") String userId,
                                            @RequestParam(value = "defId")String defId,
                                            @RequestParam(value = "leadId")String leadId,
                                            @RequestParam(value = "instId")
                                            Optional<String> instId) throws Exception;


    // 获取流程节点的列表 一些基本信息而已
    @RequestMapping(value="/${openApi.prefix}/flow/node/v1/getNodes",method= RequestMethod.GET, produces = { "application/json; charset=utf-8" })
     public CommonResult getNodes( @RequestParam(value = "defId") String defId) throws Exception;

    // 流程定义节点配置页面json数据
    @RequestMapping(value="/${openApi.prefix}/flow/node/v1/getDefSetting",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
    public CommonResult nodeDefSetting(@RequestParam(value = "defId") String defId, @RequestParam("topDefKey") String topDefKey) throws Exception;

    /**
     * 流程变量列表数据
     *  @param defId 常用语id
     *  @param nodeId 节点id
     */
    @RequestMapping(value="/${openApi.prefix}/flow/var/v1/listJson", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
    public CommonResult listJson(@RequestParam(value = "defId") String defId,@RequestParam(value = "nodeId") String nodeId) throws Exception;

    /**
     * 保存节点规则
     */
    @RequestMapping(value="/${openApi.prefix}/flow/var/v1/save",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" })
    public CommonResult<String> save(@RequestBody BpmVariableDefVo variableDefVo) throws Exception;

    /**
     * 编辑节点变量
     */
    @RequestMapping(value="/${openApi.prefix}/flow/var/v1/defVarEdit", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
    public CommonResult defVarEdit( @RequestParam(value = "defId") String defId,@RequestParam(value = "varKey") String varKey) throws Exception;

    /**
     * 保存节点规则
     * @param variableDefVo 保存节点规则
     * @return
     * @throws Exception
     */
    @RequestMapping(value="/${openApi.prefix}/flow/var/v1/save",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" })
    public CommonResult<String> saveBpmVariableDef(@RequestBody BpmVariableDefVo variableDefVo) throws Exception;


}