DataController.java 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package com.fdkankan.manage.controller;
  2. import com.fdkankan.common.response.ResultData;
  3. import com.fdkankan.manage.service.IDataService;
  4. import com.fdkankan.manage.service.ISysRoleService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RequestParam;
  9. import org.springframework.web.bind.annotation.RestController;
  10. /**
  11. * 统计分析
  12. */
  13. @RestController
  14. @RequestMapping("/service/manage/data")
  15. public class DataController {
  16. @Autowired
  17. IDataService dataService;
  18. @Autowired
  19. ISysRoleService sysRoleService;
  20. /**
  21. * 用户数据总览
  22. */
  23. @GetMapping("/userTotal")
  24. public ResultData userTotal(){
  25. return ResultData.ok(dataService.getUserTotal());
  26. }
  27. /**
  28. * 场景数据总览
  29. */
  30. @GetMapping("/sceneTotal")
  31. public ResultData sceneTotal(){
  32. return ResultData.ok(dataService.sceneTotal());
  33. }
  34. /**
  35. * 订单数据总览
  36. */
  37. @GetMapping("/orderTotal")
  38. public ResultData orderTotal(){
  39. return ResultData.ok(dataService.orderTotal());
  40. }
  41. /**
  42. *统计近半年新增用户数趋势
  43. * @param type 0:日 ,1:周,2:月
  44. * @param dataType 0 新增,1累加 ,2活跃度趋势
  45. */
  46. @GetMapping("/userTrend")
  47. public ResultData userTrend(@RequestParam(required = false,defaultValue = "0") Integer type,
  48. @RequestParam(required = false,defaultValue = "0") Integer dataType,
  49. @RequestParam(required = false) String startTime,
  50. @RequestParam(required = false) String endTime){
  51. return ResultData.ok(dataService.userTrend(type,dataType,startTime,endTime));
  52. }
  53. /**
  54. *统计近半年新线上订单趋势
  55. * @param type 0:日 ,1:周,2:月
  56. */
  57. @GetMapping("/orderTrend")
  58. public ResultData orderTrend(@RequestParam(required = false,defaultValue = "0") Integer type,
  59. @RequestParam(required = false) String startTime,
  60. @RequestParam(required = false) String endTime){
  61. return ResultData.ok(dataService.orderTrend(type,startTime,endTime));
  62. }
  63. /**
  64. *统计近半年场景新增趋势
  65. * @param type 0:日 ,1:周,2:月
  66. * @param dataType 0 新增,1累加
  67. */
  68. @GetMapping("/sceneTrend")
  69. public ResultData sceneTrend(@RequestParam(required = false,defaultValue = "0") Integer type,
  70. @RequestParam(required = false,defaultValue = "0") Integer dataType,
  71. @RequestParam(required = false) String startTime,
  72. @RequestParam(required = false) String endTime){
  73. return ResultData.ok(dataService.sceneTrend(type,dataType,startTime,endTime));
  74. }
  75. }