ShowChartsController.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package com.controller.chart;
  2. import com.model.pojo.annotation.CheckToken;
  3. import com.model.pojo.RepEntity;
  4. import com.model.vo.configVo.*;
  5. import com.server.chart.*;
  6. import com.server.dataSource.ColumnScreenService;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RequestHeader;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. import java.sql.SQLException;
  13. @RestController
  14. public class ShowChartsController {
  15. @Autowired
  16. ShowHistogramService showHistogramService;
  17. @Autowired
  18. ShowPieService showPieService;
  19. @Autowired
  20. ShowLineService showLineService;
  21. @Autowired
  22. ShowScatterService showScatterService;
  23. @Autowired
  24. ShowIndividualService showIndividualService;
  25. @Autowired
  26. ShowPopulationService showPopulationService;
  27. @Autowired
  28. ColumnScreenService columnScreenService;
  29. @Autowired
  30. GetChartsDataUtilService getChartsDataUtilService;
  31. /*
  32. 展示柱状图
  33. */
  34. @CheckToken
  35. @RequestMapping("/showHistogram")
  36. public RepEntity showHistogram(@RequestHeader String token,@RequestBody HistogramConfigInfo body){
  37. return showHistogramService.showHistogram(body, token);
  38. }
  39. /*
  40. 展示饼图
  41. */
  42. @CheckToken
  43. @RequestMapping("/showPie")
  44. public RepEntity showPie(@RequestHeader String token,@RequestBody PieConfigInfo body){
  45. return showPieService.showPie(body, token);
  46. }
  47. /*
  48. 展示Line
  49. */
  50. @CheckToken
  51. @RequestMapping("/showLine")
  52. public RepEntity showLine(@RequestHeader String token,@RequestBody LineConfigInfo body){
  53. return showLineService.showLine(body, token);
  54. }
  55. /*
  56. showScatter
  57. */
  58. @CheckToken
  59. @RequestMapping("/showScatter")
  60. public RepEntity showScatter(@RequestHeader String token,@RequestBody ScatterConfigInfo body){
  61. return showScatterService.showScatter(body, token);
  62. }
  63. /*
  64. show个体统计表
  65. */
  66. @CheckToken
  67. @RequestMapping("/showIndividual")
  68. public RepEntity showIndividual(@RequestHeader String token,@RequestBody IndividualConfigInfo body){
  69. return showIndividualService.showIndividual(body, token);
  70. }
  71. /*
  72. show总体统计表
  73. */
  74. @CheckToken
  75. @RequestMapping("/showPopulation")
  76. public RepEntity showPopulation(@RequestHeader String token,@RequestBody PopulationInfo body) throws SQLException {
  77. return showPopulationService.showPopulation(body, token);
  78. }
  79. /*
  80. 展示单列数据
  81. */
  82. @CheckToken
  83. @RequestMapping("/showScreenData")
  84. public RepEntity showScreenData(@RequestHeader String token,@RequestBody ColumnScreenInfo body){
  85. return columnScreenService.getScreenData(body, token);
  86. }
  87. /*
  88. 展示单列数据(数据源)
  89. */
  90. @CheckToken
  91. @RequestMapping("/getScreenByBaseId")
  92. public RepEntity getScreenByBaseId(@RequestHeader String token,@RequestBody ColumnScreenInfo body){
  93. return columnScreenService.getScreenByBaseId(body, token);
  94. }
  95. /*
  96. 展示图表数据信息
  97. */
  98. @CheckToken
  99. @RequestMapping("/getChartsData")
  100. public RepEntity getChartsData(@RequestHeader String token,@RequestBody ShowDataChartInfo body){
  101. return getChartsDataUtilService.getChartsData(token, body);
  102. }
  103. }