AlarmController.java 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package com.gyee.alarm.controller;
  2. import com.gyee.alarm.model.vo.AlarmCustomTag;
  3. import com.gyee.alarm.model.vo.AlarmSuperTalbeType;
  4. import com.gyee.alarm.model.vo.AlarmTag;
  5. import com.gyee.alarm.service.AlarmBtService;
  6. import com.gyee.alarm.service.AlarmCtService;
  7. import com.gyee.alarm.service.AlarmInService;
  8. import com.gyee.alarm.service.AlarmWtService;
  9. import org.springframework.web.bind.annotation.*;
  10. import javax.annotation.Resource;
  11. import javax.websocket.EncodeException;
  12. import java.io.IOException;
  13. import java.util.List;
  14. /**
  15. * <p>
  16. * 动态功率数据 前端控制器
  17. * </p>
  18. *
  19. * @author shilin
  20. * @since 2022-10-27
  21. */
  22. @RestController
  23. @RequestMapping("/api/alarm")
  24. public class AlarmController {
  25. @Resource
  26. private AlarmWtService alarmWtService;
  27. @Resource
  28. private AlarmBtService alarmBtService;
  29. @Resource
  30. private AlarmCtService alarmCtService;
  31. @Resource
  32. private AlarmInService alarmInService;
  33. @GetMapping("/wtTags")
  34. public List<AlarmTag> findTagsByWt()
  35. {
  36. List<AlarmTag> ls = alarmWtService.findTags(AlarmSuperTalbeType.WT.getCode());
  37. return ls;
  38. }
  39. @GetMapping("/btTags")
  40. public List<AlarmTag> findTagsByBt()
  41. {
  42. List<AlarmTag> ls = alarmBtService.findTags(AlarmSuperTalbeType.BT.getCode());
  43. return ls;
  44. }
  45. @GetMapping("/inTags")
  46. public List<AlarmTag> findTagsByIn()
  47. {
  48. List<AlarmTag> ls = alarmInService.findTags(AlarmSuperTalbeType.WT.getCode());
  49. return ls;
  50. }
  51. @GetMapping("/ctTags")
  52. public List<AlarmCustomTag> findTagsByCt()
  53. {
  54. List<AlarmCustomTag> ls = alarmCtService.findTags(AlarmSuperTalbeType.CT.getCode());
  55. return ls;
  56. }
  57. @PostMapping("/saveWtTags")
  58. public void saveWtTags(@RequestBody List<AlarmTag> alarms ) throws EncodeException, IOException {
  59. alarmWtService.saveAlarms(alarms);
  60. }
  61. @PostMapping("/saveBtTags")
  62. public void saveBtTags(@RequestBody List<AlarmTag> alarms ) throws EncodeException, IOException {
  63. alarmBtService.saveAlarms(alarms);
  64. }
  65. @PostMapping("/saveCtTags")
  66. public void saveCtTags(@RequestBody List<AlarmTag> alarms ) throws EncodeException, IOException {
  67. alarmCtService.saveAlarms(alarms);
  68. }
  69. @PostMapping("/saveInTags")
  70. public void saveInTags(@RequestBody List<AlarmTag> alarms ) throws EncodeException, IOException {
  71. alarmInService.saveAlarms(alarms);
  72. }
  73. @PostMapping("/updateInTags")
  74. public void updateInTags(@RequestBody List<AlarmTag> alarms ) {
  75. alarmInService.updateAlarms(alarms);
  76. }
  77. @PostMapping("/updateWtTags")
  78. public void updateWtTags(@RequestBody List<AlarmTag> alarms ) {
  79. alarmWtService.updateAlarms(alarms);
  80. }
  81. @PostMapping("/updateBtTags")
  82. public void updateBtTags(@RequestBody List<AlarmTag> alarms ) {
  83. alarmBtService.updateAlarms(alarms);
  84. }
  85. @PostMapping("/updateCtTags")
  86. public void updateCtTags(@RequestBody List<AlarmTag> alarms ) {
  87. alarmCtService.updateAlarms(alarms);
  88. }
  89. }