FlowNodelineController.java 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the dreamlu.net developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: Chill 庄骞 (smallchill@163.com)
  16. */
  17. package com.fjhx.flow.controller;
  18. import com.fjhx.flow.service.IFlowNodelineService;
  19. import com.fjhx.myapp.application.entity.FlowNodeline;
  20. import io.swagger.annotations.Api;
  21. import io.swagger.annotations.ApiParam;
  22. import lombok.AllArgsConstructor;
  23. import org.springblade.common.constant.ApiConstant;
  24. import org.springblade.core.boot.ctrl.BladeController;
  25. import org.springblade.core.mp.support.Condition;
  26. import org.springblade.core.tool.api.R;
  27. import org.springblade.core.tool.utils.Func;
  28. import org.springframework.web.bind.annotation.*;
  29. import javax.validation.Valid;
  30. import java.util.Date;
  31. /**
  32. * 流程节点连线 控制器
  33. *
  34. * @author BladeX
  35. * @since 2022-07-20
  36. */
  37. @RestController
  38. @AllArgsConstructor
  39. @RequestMapping(ApiConstant.Project.SAAS_FLOW_REQUEST_PREFIX + "/flownodeline")
  40. @Api(value = "流程节点连线", tags = "流程节点连线接口")
  41. public class FlowNodelineController extends BladeController {
  42. private final IFlowNodelineService flowNodelineService;
  43. /**
  44. * 详情
  45. */
  46. @GetMapping("/detail")
  47. public R<FlowNodeline> detail(FlowNodeline flowNodeline) {
  48. FlowNodeline detail = flowNodelineService.getOne(Condition.getQueryWrapper(flowNodeline));
  49. return R.data(detail);
  50. }
  51. /**
  52. * 新增 流程节点连线
  53. */
  54. @PostMapping("/save")
  55. public R save(@Valid @RequestBody FlowNodeline flowNodeline) {
  56. flowNodeline.setCreatedTime(new Date());
  57. return R.status(flowNodelineService.save(flowNodeline));
  58. }
  59. /**
  60. * 修改 流程节点连线
  61. */
  62. @PostMapping("/update")
  63. public R update(@Valid @RequestBody FlowNodeline flowNodeline) {
  64. flowNodeline.setUpdatedTime(new Date());
  65. return R.status(flowNodelineService.updateById(flowNodeline));
  66. }
  67. /**
  68. * 新增或修改 流程节点连线
  69. */
  70. @PostMapping("/submit")
  71. public R submit(@Valid @RequestBody FlowNodeline flowNodeline) {
  72. return R.status(flowNodelineService.saveOrUpdate(flowNodeline));
  73. }
  74. /**
  75. * 删除 流程节点连线
  76. */
  77. @PostMapping("/remove")
  78. public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
  79. return R.status(flowNodelineService.removeByIds(Func.toLongList(ids)));
  80. }
  81. }