1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package com.fdkankan.manage.controller;
- import com.fdkankan.common.response.ResultData;
- import com.fdkankan.manage.service.IDataService;
- import com.fdkankan.manage.service.ISysRoleService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * 统计分析
- */
- @RestController
- @RequestMapping("/service/manage/data")
- public class DataController {
- @Autowired
- IDataService dataService;
- @Autowired
- ISysRoleService sysRoleService;
- /**
- * 用户数据总览
- */
- @GetMapping("/userTotal")
- public ResultData userTotal(){
- return ResultData.ok(dataService.getUserTotal());
- }
- /**
- * 场景数据总览
- */
- @GetMapping("/sceneTotal")
- public ResultData sceneTotal(){
- return ResultData.ok(dataService.sceneTotal());
- }
- /**
- * 订单数据总览
- */
- @GetMapping("/orderTotal")
- public ResultData orderTotal(){
- return ResultData.ok(dataService.orderTotal());
- }
- /**
- *统计近半年新增用户数趋势
- * @param type 0:日 ,1:周,2:月
- * @param dataType 0 新增,1累加 ,2活跃度趋势
- */
- @GetMapping("/userTrend")
- public ResultData userTrend(@RequestParam(required = false,defaultValue = "0") Integer type,
- @RequestParam(required = false,defaultValue = "0") Integer dataType,
- @RequestParam(required = false) String startTime,
- @RequestParam(required = false) String endTime){
- return ResultData.ok(dataService.userTrend(type,dataType,startTime,endTime));
- }
- /**
- *统计近半年新线上订单趋势
- * @param type 0:日 ,1:周,2:月
- */
- @GetMapping("/orderTrend")
- public ResultData orderTrend(@RequestParam(required = false,defaultValue = "0") Integer type,
- @RequestParam(required = false) String startTime,
- @RequestParam(required = false) String endTime){
- return ResultData.ok(dataService.orderTrend(type,startTime,endTime));
- }
- /**
- *统计近半年场景新增趋势
- * @param type 0:日 ,1:周,2:月
- * @param dataType 0 新增,1累加
- */
- @GetMapping("/sceneTrend")
- public ResultData sceneTrend(@RequestParam(required = false,defaultValue = "0") Integer type,
- @RequestParam(required = false,defaultValue = "0") Integer dataType,
- @RequestParam(required = false) String startTime,
- @RequestParam(required = false) String endTime){
- return ResultData.ok(dataService.sceneTrend(type,dataType,startTime,endTime));
- }
- }
|