IndexController.java
4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package com.glsx.controller;
import java.util.HashMap;
import java.util.Map;
import com.glsx.service.ApiCallMgrService;
import com.glsx.service.AppDownloadMgrService;
import com.glsx.service.CustomerMgrService;
import com.glsx.service.DeviceMgrService;
import com.glsx.service.IndexService;
import com.glsx.service.UserMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* @author deployer name
* @version V1.0
* @Title: IndexController.java
* @Description:
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Api
@RestController
@RequestMapping(value = "/index")
public class IndexController {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(IndexController.class);
@Autowired
private CustomerMgrService customerMgrService;
@Autowired
private DeviceMgrService deviceMgrService;
@Autowired
private UserMgrService userMgrService;
@Autowired
private ApiCallMgrService apiCallMgrService;
@Autowired
private AppDownloadMgrService appDownloadMgrService;
@Autowired
private IndexService indexService;
@RequestMapping(value = "/getStatisticData", method = RequestMethod.GET)
@ResponseBody
public R getStatisticData() {
Map<String, Integer> hashMap = new HashMap<>();
int customerCount = customerMgrService.getCustomerCount();
int deviceCount = deviceMgrService.getDeviceCount();
int userCount = userMgrService.getUserCount();
int apiCallCount = apiCallMgrService.getApiCallCount();
hashMap.put("customerCount", customerCount);
hashMap.put("deviceCount", deviceCount);
hashMap.put("userCount", userCount);
hashMap.put("apiCallCount", apiCallCount);
return R.ok().data(hashMap);
}
@RequestMapping(value = "/getGraphData", method = RequestMethod.GET)
@ResponseBody
public R getGraphData() {
Map<String, Map<String, Integer>> hashMap = new HashMap<>();
Map<String, Integer> deviceGraphData = deviceMgrService.getDeviceGraphData();
Map<String, Integer> apiCallGraphData = apiCallMgrService.getApiCallGraphData();
hashMap.put("deviceGraphData", deviceGraphData);
hashMap.put("apiCallGraphData", apiCallGraphData);
return R.ok().data(hashMap);
}
@RequestMapping(value = "/getPolylineData", method = RequestMethod.GET)
@ResponseBody
public R getPolylineData() {
HashMap<String, Integer> hashMap = new HashMap<>();
int customerCount = customerMgrService.getCustomerCount();
int deviceCount = deviceMgrService.getDeviceCount();
int userCount = userMgrService.getUserCount();
int apiCallCount = apiCallMgrService.getApiCallCount();
hashMap.put("customerCount", customerCount);
hashMap.put("deviceCount", deviceCount);
hashMap.put("userCount", userCount);
hashMap.put("apiCallCount", apiCallCount);
return R.ok().data(hashMap);
}
@RequestMapping(value = "/getUcSummaryStatistic", method = RequestMethod.GET)
@ResponseBody
public R getUcSummaryStatistic(String customerName) {
Map<String, Integer> statisticMap = this.indexService.getUcSummaryStatistic(customerName);
return R.ok().data(statisticMap);
}
@RequestMapping(value = "/getUcDeviceActivationStatistic", method = RequestMethod.GET)
public R getUcDeviceActivationStatistic(String customerName) {
Map<String, Integer> statisticMap = this.indexService
.getUcDeviceActivationStatistic(customerName);
return R.ok().data(statisticMap);
}
@RequestMapping(value = "/getUcUserActivityStatistic", method = RequestMethod.GET)
public R getUcUserActivityStatistic(String customerName) {
Map<String, Integer> statisticMap = this.indexService
.getUcUserActivityStatistic(customerName);
return R.ok().data(statisticMap);
}
@RequestMapping(value = "/getUcAppDownloadStatistic", method = RequestMethod.GET)
public R getUcAppDownloadStatistic(String customerName) {
Map<String, Integer> statisticMap = this.indexService
.getUcAppDownloadStatistic(customerName);
return R.ok().data(statisticMap);
}
}