lxw
2023-05-25 f3c27fb78447449a950ba73c5e72ceda64ad8a12
src/main/java/com/whyc/controller/WorkflowActionController.java
@@ -1,8 +1,10 @@
package com.whyc.controller;
import com.whyc.dto.Response;
import com.whyc.pojo.UserInf;
import com.whyc.pojo.WorkflowAction;
import com.whyc.service.WorkflowActionService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,15 +31,26 @@
    @PutMapping
    @ApiOperation(value = "更新动作规则")
    public Response update(@RequestBody WorkflowAction workflowAction){
        service.update(workflowAction);
    public Response update(@RequestBody List<WorkflowAction> workflowActionList){
        service.update(workflowActionList);
        return new Response().setII(1,"更新成功");
    }
    @GetMapping("actionTypeList")
    @ApiOperation(value = "查询动作类型列表")
    public Response<Map<Integer,List<WorkflowAction>>> getActionTypeList(@RequestParam Integer type,@RequestParam Integer linkType){
        Map<Integer,List<WorkflowAction>> actionTypeList = service.getActionTypeList(type,linkType);
        return new Response<Map<Integer,List<WorkflowAction>>>().set(1,actionTypeList);
    @GetMapping("actionTypeList4Link")
    @ApiOperation(value = "查询节点的动作类型列表")
    public Response<List<WorkflowAction>> getActionTypeList4Link(@RequestParam Integer type,@RequestParam Integer linkType){
        List<WorkflowAction> actionTypeList = service.getActionTypeList4Link(type,linkType);
        return new Response<List<WorkflowAction>>().set(1,actionTypeList);
    }
    /**
     * @see com.whyc.constant.RoleEnum 用户角色说明
     */
    @GetMapping("actionTypeList4Role")
    @ApiOperation(value = "查询动作列表")
    public Response getActionTypeList(@RequestParam Integer type,@RequestParam Integer status){
        int userRole = ActionUtil.getUser().getURole();
        List<WorkflowAction> actionTypeList = service.getActionTypeList(type,status,userRole);
        return new Response<List<WorkflowAction>>().set(1,actionTypeList);
    }
}