feat(dify): 为工作流相关操作添加数据权限和操作日志注解

- 在工作流详情页面添加数据权限控制
- 在工作流删除操作上添加操作日志注解
- 在工作流查询页面添加数据权限控制
This commit is contained in:
zhuangtianxiang 2025-05-16 17:35:16 +08:00
parent 5ea0ad3edc
commit b299e5a6b1

View File

@ -121,6 +121,7 @@ public class V1WorkflowController {
*/ */
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
@PreAuthorize("hasAuthority('dify:workflow:query')") @PreAuthorize("hasAuthority('dify:workflow:query')")
@DataPermission
public WorkflowData detail(@PathVariable Long id){ public WorkflowData detail(@PathVariable Long id){
return difyWorkflowService.detail(id); return difyWorkflowService.detail(id);
} }
@ -133,6 +134,7 @@ public class V1WorkflowController {
*/ */
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('dify:workflow:delete')") @PreAuthorize("hasAuthority('dify:workflow:delete')")
@OperationLogAnnotation(content = "'dify工作流日志'", operationType = "删除")
public boolean delete(@PathVariable Long id){ public boolean delete(@PathVariable Long id){
return difyWorkflowService.delete(id); return difyWorkflowService.delete(id);
} }
@ -145,6 +147,7 @@ public class V1WorkflowController {
*/ */
@GetMapping("/query") @GetMapping("/query")
@PreAuthorize("hasAuthority('dify:workflow:query')") @PreAuthorize("hasAuthority('dify:workflow:query')")
@DataPermission
public Page<WorkflowData> query(Page<WorkflowData> page){ public Page<WorkflowData> query(Page<WorkflowData> page){
return difyWorkflowService.query(page); return difyWorkflowService.query(page);
} }