feat: 3.1.0

1. 修复工作流权限问题
This commit is contained in:
byteblogs168 2024-03-03 23:03:12 +08:00
parent f0a6d5d4fc
commit 9ed6756548
5 changed files with 11 additions and 7 deletions

View File

@ -35,6 +35,7 @@ public class WorkflowBatchController {
}
@PostMapping("/stop/{id}")
@LoginRequired
public Boolean stop(@PathVariable("id") Long id) {
return workflowBatchService.stop(id);
}

View File

@ -31,7 +31,7 @@ public class WorkflowController {
private final WorkflowService workflowService;
@PostMapping
@LoginRequired(role = RoleEnum.ADMIN)
@LoginRequired(role = RoleEnum.USER)
public Boolean saveWorkflow(@RequestBody @Validated WorkflowRequestVO workflowRequestVO) {
return workflowService.saveWorkflow(workflowRequestVO);
}
@ -43,7 +43,7 @@ public class WorkflowController {
}
@PutMapping
@LoginRequired(role = RoleEnum.ADMIN)
@LoginRequired(role = RoleEnum.USER)
public Boolean updateWorkflow(@RequestBody @Validated WorkflowRequestVO workflowRequestVO) {
return workflowService.updateWorkflow(workflowRequestVO);
}
@ -55,7 +55,7 @@ public class WorkflowController {
}
@PutMapping("/update/status/{id}")
@LoginRequired(role = RoleEnum.ADMIN)
@LoginRequired(role = RoleEnum.USER)
public Boolean updateStatus(@PathVariable("id") Long id) {
return workflowService.updateStatus(id);
}
@ -81,7 +81,7 @@ public class WorkflowController {
}
@PostMapping("/check-node-expression")
@LoginRequired(role = RoleEnum.ADMIN)
@LoginRequired(role = RoleEnum.USER)
public Pair<Integer, String> checkNodeExpression(@RequestBody DecisionConfig decisionConfig) {
return workflowService.checkNodeExpression(decisionConfig);
}

View File

@ -1,5 +1,7 @@
package com.aizuda.easy.retry.server.web.controller;
import com.aizuda.easy.retry.server.web.annotation.LoginRequired;
import com.aizuda.easy.retry.server.web.annotation.RoleEnum;
import com.aizuda.easy.retry.server.web.service.WorkflowNodeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
@ -19,12 +21,14 @@ public class WorkflowNodeController {
private final WorkflowNodeService workflowNodeService;
@PostMapping("/stop/{nodeId}/{workflowTaskBatchId}")
@LoginRequired(role = RoleEnum.USER)
public Boolean stop(@PathVariable("nodeId") Long nodeId,
@PathVariable("workflowTaskBatchId") Long workflowTaskBatchId) {
return workflowNodeService.stop(nodeId, workflowTaskBatchId);
}
@PostMapping("/retry/{nodeId}/{workflowTaskBatchId}")
@LoginRequired(role = RoleEnum.USER)
public Boolean retry(@PathVariable("nodeId") Long nodeId,
@PathVariable("workflowTaskBatchId") Long workflowTaskBatchId) {
return workflowNodeService.retry(nodeId, workflowTaskBatchId);

View File

@ -37,7 +37,7 @@
:data="loadData"
:alert="options.alert"
:rowSelection="options.rowSelection"
:scroll="{ x: 1800 }"
:scroll="{ x: 2000 }"
>
<span slot="groupName" slot-scope="text, record">
<a href="#" @click="handlerOpenDrawer(record)">{{ text }}</a>

View File

@ -119,7 +119,7 @@
>
<a href="javascript:;" v-if="record.workflowStatus === 0">开启</a>
</a-popconfirm>
<a-divider type="vertical" v-if="record.workflowStatus === 0" />
<a-divider type="vertical" v-if="record.workflowStatus === 0 && $auth('job.del')" />
<a-popconfirm
title="是否删除工作流?"
ok-text="删除"
@ -135,7 +135,6 @@
ok-text="复制"
cancel-text="取消"
@confirm="handleCopy(record)"
v-if="$auth('job.del')"
>
<a href="javascript:;">复制</a>
</a-popconfirm>