HomeController.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package com.lightinit.hsdatashow.controller.admin;
  2. import com.lightinit.hsdatashow.dictionary.DicCategoryIndex;
  3. import com.lightinit.hsdatashow.model.ResultState;
  4. import com.lightinit.hsdatashow.service.admin.ICockpitService;
  5. import com.lightinit.hsdatashow.service.admin.IHomeService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Controller;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.ResponseBody;
  10. import org.springframework.web.servlet.ModelAndView;
  11. import java.util.ArrayList;
  12. /**
  13. * 用户管理
  14. */
  15. @Controller("adminHomeController")
  16. @RequestMapping(value = {"/admin", "/admin/home"})
  17. public class HomeController {
  18. @Autowired
  19. private IHomeService homeService;
  20. @Autowired
  21. private ICockpitService cockpitService;
  22. @RequestMapping(value = {"/", "/index.action"})
  23. public ModelAndView index(){
  24. ModelAndView modelAndView = new ModelAndView("admin/home/index");
  25. return modelAndView;
  26. }
  27. /*
  28. *@Description 城市绿化
  29. *@Param
  30. *@Date 2018/8/15
  31. *@return
  32. **/
  33. @RequestMapping(value="moreindex.action")
  34. @ResponseBody
  35. public ResultState getMoreIndex(){
  36. ArrayList<String> findIndexes = new ArrayList<>();
  37. findIndexes.add(DicCategoryIndex.SOCIETYDEVELOPINDEX);
  38. findIndexes.add(DicCategoryIndex.ECOLOGICALENVIRONMENTINDEX);
  39. findIndexes.add(DicCategoryIndex.RESIDENTSERVICEINDEX);
  40. findIndexes.add(DicCategoryIndex.SOCIETYSECURITYINDEX);
  41. return cockpitService.getIndex(findIndexes);
  42. }
  43. /*
  44. *@Description 城市绿化
  45. *@Param
  46. *@Date 2018/8/15
  47. *@return
  48. **/
  49. @RequestMapping(value="citygreening.action")
  50. @ResponseBody
  51. public ResultState getCityGreening(){
  52. return homeService.getCityGreening();
  53. }
  54. /*
  55. *@Description 社会安全
  56. *@Param
  57. *@Date 2018/8/15
  58. *@return
  59. **/
  60. @RequestMapping(value="societysecurity.action")
  61. @ResponseBody
  62. public ResultState getSocietySecurity(){
  63. return homeService.getSocietySecurity();
  64. }
  65. /*
  66. *@Description 污染指数
  67. *@Param
  68. *@Date 2018/8/16
  69. *@return
  70. **/
  71. @RequestMapping(value="pollutionindex.action")
  72. @ResponseBody
  73. public ResultState getPollutionIndex(){
  74. return homeService.getPollutionIndex();
  75. }
  76. /*
  77. *@Description 社会发展
  78. *@Param
  79. *@Date 2018/8/15
  80. *@return
  81. **/
  82. @RequestMapping(value="societydevelop.action")
  83. @ResponseBody
  84. public ResultState getSocietyDevelop(){
  85. return homeService.getSocietyDevelop();
  86. }
  87. }