|
@@ -0,0 +1,39 @@
|
|
1
|
+package com.yunzhi.demo.controller;
|
|
2
|
+
|
|
3
|
+import com.yunzhi.demo.common.BaseController;
|
|
4
|
+import com.yunzhi.demo.common.ResponseBean;
|
|
5
|
+import com.yunzhi.demo.service.ITaPersonService;
|
|
6
|
+import com.yunzhi.demo.service.ITaPostDataService;
|
|
7
|
+import io.swagger.annotations.Api;
|
|
8
|
+import io.swagger.annotations.ApiOperation;
|
|
9
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
10
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
11
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
12
|
+import org.springframework.web.bind.annotation.RestController;
|
|
13
|
+
|
|
14
|
+import java.util.Map;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+@Api(tags = "查询统计")
|
|
18
|
+@RestController
|
|
19
|
+public class StatisticController extends BaseController {
|
|
20
|
+
|
|
21
|
+ @Autowired
|
|
22
|
+ ITaPostDataService iTaPostDataService;
|
|
23
|
+
|
|
24
|
+ @Autowired
|
|
25
|
+ ITaPersonService iTaPersonService;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+ @GetMapping("/admin/index/post-data")
|
|
29
|
+ @ApiOperation(value="首页简单的几个统计", notes = "首页简单的几个统计", httpMethod = "GET", response = ResponseBean.class)
|
|
30
|
+ public ResponseBean getIndexPostData() {
|
|
31
|
+
|
|
32
|
+ Map<String, Object> result = iTaPostDataService.getIndexBasicData();
|
|
33
|
+
|
|
34
|
+ int totalStudents = iTaPersonService.countStudent();
|
|
35
|
+ result.put("student", totalStudents);
|
|
36
|
+
|
|
37
|
+ return ResponseBean.success(result);
|
|
38
|
+ }
|
|
39
|
+}
|