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}") @PostMapping("/stop/{id}")
@LoginRequired
public Boolean stop(@PathVariable("id") Long id) { public Boolean stop(@PathVariable("id") Long id) {
return workflowBatchService.stop(id); return workflowBatchService.stop(id);
} }

View File

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

View File

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

View File

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

View File

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