| | |
| | | import com.ruoyi.approve.bean.dto.ApprovalTemplateDto; |
| | | import com.ruoyi.approve.bean.vo.ApprovalTemplateVo; |
| | | import com.ruoyi.approve.service.ApprovalTemplateService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @RequestMapping("/approvalTemplate") |
| | | @Tag(name = "审批模板表") |
| | | @AllArgsConstructor |
| | | public class ApprovalTemplateController { |
| | | public class ApprovalTemplateController extends BaseController { |
| | | |
| | | private final ApprovalTemplateService approvalTemplateService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "分页查询") |
| | | @Log(title = "审批模板分页查询", businessType = BusinessType.OTHER) |
| | | public R listPage(Page<ApprovalTemplateVo> page, ApprovalTemplateDto approvalTemplateDto) { |
| | | return R.ok(approvalTemplateService.listPage(page, approvalTemplateDto)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "添加") |
| | | @Log(title = "添加审批模板", businessType = BusinessType.INSERT) |
| | | public R add(@RequestBody ApprovalTemplateDto approvalTemplateDto) { |
| | | return R.ok(approvalTemplateService.saveApprovalTemplateDto(approvalTemplateDto)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "修改") |
| | | @Log(title = "修改审批模板", businessType = BusinessType.UPDATE) |
| | | public R update(@RequestBody ApprovalTemplateDto approvalTemplateDto) { |
| | | return R.ok(approvalTemplateService.updateApprovalTemplateDto(approvalTemplateDto)); |
| | | } |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除") |
| | | @Log(title = "删除审批模板", businessType = BusinessType.DELETE) |
| | | public R delete(@RequestBody List<Long> ids) { |
| | | return R.ok(approvalTemplateService.delete(ids)); |
| | | } |
| | |
| | | |
| | | @GetMapping("/detail/{id}") |
| | | @Operation(summary = "查询审批模板详情") |
| | | @Log(title = "查询审批模板详情", businessType = BusinessType.OTHER) |
| | | public R detail(@PathVariable("id") Long id) { |
| | | return R.ok(approvalTemplateService.getApprovalTemplateVoById(id)); |
| | | } |