DebugFaultController.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.ruoyi.sim.controller;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import com.ruoyi.sim.service.impl.DebugFaultService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.PutMapping;
  9. import org.springframework.web.bind.annotation.DeleteMapping;
  10. import org.springframework.web.bind.annotation.PathVariable;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import com.ruoyi.common.core.controller.BaseController;
  15. import com.ruoyi.common.core.domain.AjaxResult;
  16. import com.ruoyi.sim.domain.DebugFault;
  17. import com.ruoyi.common.core.page.TableDataInfo;
  18. /**
  19. * 调试故障Controller
  20. *
  21. * @author tom
  22. * @date 2025-02-10
  23. */
  24. @RestController
  25. @RequestMapping("/sim/debug-fault")
  26. public class DebugFaultController extends BaseController {
  27. @Autowired
  28. private DebugFaultService debugFaultService;
  29. /**
  30. * 查询调试故障列表
  31. */
  32. @GetMapping("/list")
  33. public TableDataInfo list(DebugFault debugFault) {
  34. startPage();
  35. List<DebugFault> list = debugFaultService.selectDebugFaultList(debugFault);
  36. return getDataTable(list);
  37. }
  38. /**
  39. * 获取调试故障详细信息
  40. */
  41. @GetMapping(value = "/{refId}")
  42. public AjaxResult getInfo(@PathVariable("refId") Long refId) {
  43. return success(debugFaultService.selectDebugFaultByRefId(refId));
  44. }
  45. /**
  46. * 新增调试故障
  47. */
  48. @PostMapping
  49. public AjaxResult add(@RequestBody DebugFault debugFault) {
  50. return toAjax(debugFaultService.insertDebugFault(debugFault));
  51. }
  52. /**
  53. * 修改调试故障
  54. */
  55. @PutMapping
  56. public AjaxResult edit(@RequestBody DebugFault debugFault) {
  57. return toAjax(debugFaultService.updateDebugFault(debugFault));
  58. }
  59. /**
  60. * 删除调试故障
  61. */
  62. @DeleteMapping("/{refIds}")
  63. public AjaxResult remove(@PathVariable Long[] refIds) {
  64. return toAjax(debugFaultService.deleteDebugFaultByRefIds(refIds));
  65. }
  66. }