潘志宝
9 天以前 6b13839488edcd06046e26a41fe897358176689c
提交 | 用户 | 时间
e7c126 1 package com.iailab.module.bpm.controller.admin.definition;
H 2
3 import com.iailab.framework.common.pojo.CommonResult;
4 import com.iailab.framework.common.pojo.PageResult;
5 import com.iailab.framework.common.util.object.BeanUtils;
6 import com.iailab.module.bpm.controller.admin.definition.vo.expression.BpmProcessExpressionPageReqVO;
7 import com.iailab.module.bpm.controller.admin.definition.vo.expression.BpmProcessExpressionRespVO;
8 import com.iailab.module.bpm.controller.admin.definition.vo.expression.BpmProcessExpressionSaveReqVO;
9 import com.iailab.module.bpm.dal.dataobject.definition.BpmProcessExpressionDO;
10 import com.iailab.module.bpm.service.definition.BpmProcessExpressionService;
11 import io.swagger.v3.oas.annotations.Operation;
12 import io.swagger.v3.oas.annotations.Parameter;
13 import io.swagger.v3.oas.annotations.tags.Tag;
14 import org.springframework.security.access.prepost.PreAuthorize;
15 import org.springframework.validation.annotation.Validated;
16 import org.springframework.web.bind.annotation.*;
17
18 import javax.annotation.Resource;
19 import javax.validation.Valid;
20
21 import static com.iailab.framework.common.pojo.CommonResult.success;
22
23 @Tag(name = "管理后台 - BPM 流程表达式")
24 @RestController
25 @RequestMapping("/bpm/process-expression")
26 @Validated
27 public class BpmProcessExpressionController {
28
29     @Resource
30     private BpmProcessExpressionService processExpressionService;
31
32     @PostMapping("/create")
33     @Operation(summary = "创建流程表达式")
34     @PreAuthorize("@ss.hasPermission('bpm:process-expression:create')")
35     public CommonResult<Long> createProcessExpression(@Valid @RequestBody BpmProcessExpressionSaveReqVO createReqVO) {
36         return success(processExpressionService.createProcessExpression(createReqVO));
37     }
38
39     @PutMapping("/update")
40     @Operation(summary = "更新流程表达式")
41     @PreAuthorize("@ss.hasPermission('bpm:process-expression:update')")
42     public CommonResult<Boolean> updateProcessExpression(@Valid @RequestBody BpmProcessExpressionSaveReqVO updateReqVO) {
43         processExpressionService.updateProcessExpression(updateReqVO);
44         return success(true);
45     }
46
47     @DeleteMapping("/delete")
48     @Operation(summary = "删除流程表达式")
49     @Parameter(name = "id", description = "编号", required = true)
50     @PreAuthorize("@ss.hasPermission('bpm:process-expression:delete')")
51     public CommonResult<Boolean> deleteProcessExpression(@RequestParam("id") Long id) {
52         processExpressionService.deleteProcessExpression(id);
53         return success(true);
54     }
55
56     @GetMapping("/get")
57     @Operation(summary = "获得流程表达式")
58     @Parameter(name = "id", description = "编号", required = true, example = "1024")
59     @PreAuthorize("@ss.hasPermission('bpm:process-expression:query')")
60     public CommonResult<BpmProcessExpressionRespVO> getProcessExpression(@RequestParam("id") Long id) {
61         BpmProcessExpressionDO processExpression = processExpressionService.getProcessExpression(id);
62         return success(BeanUtils.toBean(processExpression, BpmProcessExpressionRespVO.class));
63     }
64
65     @GetMapping("/page")
66     @Operation(summary = "获得流程表达式分页")
67     @PreAuthorize("@ss.hasPermission('bpm:process-expression:query')")
68     public CommonResult<PageResult<BpmProcessExpressionRespVO>> getProcessExpressionPage(
69             @Valid BpmProcessExpressionPageReqVO pageReqVO) {
70         PageResult<BpmProcessExpressionDO> pageResult = processExpressionService.getProcessExpressionPage(pageReqVO);
71         return success(BeanUtils.toBean(pageResult, BpmProcessExpressionRespVO.class));
72     }
73
bb2880 74
e7c126 75 }