|
|
@@ -2,9 +2,15 @@ package vip.xiaonuo.exam.controller.admin;
|
|
|
|
|
|
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.RestController;
|
|
|
import vip.xiaonuo.exam.base.BaseApiController;
|
|
|
+import vip.xiaonuo.exam.base.RestResponse;
|
|
|
import vip.xiaonuo.exam.service.*;
|
|
|
+import vip.xiaonuo.exam.utility.DateTimeUtil;
|
|
|
+import vip.xiaonuo.exam.viewmodel.admin.dashboard.IndexVM;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RestController("AdminDashboardController")
|
|
|
@RequestMapping(value = "/api/admin/dashboard")
|
|
|
@@ -25,26 +31,26 @@ public class DashboardController extends BaseApiController {
|
|
|
this.userEventLogService = userEventLogService;
|
|
|
}
|
|
|
|
|
|
-// @RequestMapping(value = "/index", method = RequestMethod.POST)
|
|
|
-// public RestResponse<IndexVM> Index() {
|
|
|
-// IndexVM vm = new IndexVM();
|
|
|
-//
|
|
|
-// Integer examPaperCount = examPaperService.selectAllCount();
|
|
|
-// Integer questionCount = questionService.selectAllCount();
|
|
|
-// Integer doExamPaperCount = examPaperAnswerService.selectAllCount();
|
|
|
-// Integer doQuestionCount = examPaperQuestionCustomerAnswerService.selectAllCount();
|
|
|
-//
|
|
|
-// vm.setExamPaperCount(examPaperCount);
|
|
|
-// vm.setQuestionCount(questionCount);
|
|
|
-// vm.setDoExamPaperCount(doExamPaperCount);
|
|
|
-// vm.setDoQuestionCount(doQuestionCount);
|
|
|
-//
|
|
|
-// List<Integer> mothDayUserActionValue = userEventLogService.selectMothCount();
|
|
|
-// List<Integer> mothDayDoExamQuestionValue = examPaperQuestionCustomerAnswerService.selectMothCount();
|
|
|
-// vm.setMothDayUserActionValue(mothDayUserActionValue);
|
|
|
-// vm.setMothDayDoExamQuestionValue(mothDayDoExamQuestionValue);
|
|
|
-//
|
|
|
-// vm.setMothDayText(DateTimeUtil.MothDay());
|
|
|
-// return RestResponse.ok(vm);
|
|
|
- // }
|
|
|
+ @RequestMapping(value = "/index", method = RequestMethod.POST)
|
|
|
+ public RestResponse<IndexVM> Index() {
|
|
|
+ IndexVM vm = new IndexVM();
|
|
|
+
|
|
|
+ Integer examPaperCount = examPaperService.selectAllCount();
|
|
|
+ Integer questionCount = questionService.selectAllCount();
|
|
|
+ Integer doExamPaperCount = examPaperAnswerService.selectAllCount();
|
|
|
+ Integer doQuestionCount = examPaperQuestionCustomerAnswerService.selectAllCount();
|
|
|
+
|
|
|
+ vm.setExamPaperCount(examPaperCount);
|
|
|
+ vm.setQuestionCount(questionCount);
|
|
|
+ vm.setDoExamPaperCount(doExamPaperCount);
|
|
|
+ vm.setDoQuestionCount(doQuestionCount);
|
|
|
+
|
|
|
+ List<Integer> mothDayUserActionValue = userEventLogService.selectMothCount();
|
|
|
+ List<Integer> mothDayDoExamQuestionValue = examPaperQuestionCustomerAnswerService.selectMothCount();
|
|
|
+ vm.setMothDayUserActionValue(mothDayUserActionValue);
|
|
|
+ vm.setMothDayDoExamQuestionValue(mothDayDoExamQuestionValue);
|
|
|
+
|
|
|
+ vm.setMothDayText(DateTimeUtil.MothDay());
|
|
|
+ return RestResponse.ok(vm);
|
|
|
+ }
|
|
|
}
|