deason il y a 6 ans
Parent
commit
84804363ca

+ 19 - 0
examcloud-core-print-starter/src/main/java/cn/com/qmth/examcloud/core/print/controller/IndexController.java

@@ -7,9 +7,14 @@
 
 package cn.com.qmth.examcloud.core.print.controller;
 
+import cn.com.qmth.examcloud.core.print.service.CourseStatisticService;
+import cn.com.qmth.examcloud.core.print.service.PrintingProjectService;
+import cn.com.qmth.examcloud.core.print.service.PrintingProjectStatisticService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpServletRequest;
 
@@ -19,10 +24,24 @@ import javax.servlet.http.HttpServletRequest;
  */
 @Controller
 public class IndexController {
+    @Autowired
+    private CourseStatisticService courseStatisticService;
+    @Autowired
+    private PrintingProjectService printingProjectService;
+    @Autowired
+    private PrintingProjectStatisticService printingProjectStatisticService;
 
     @RequestMapping(value = "/", method = RequestMethod.GET)
     public String index(HttpServletRequest request) throws Exception {
         return "redirect:/doc.html";
     }
 
+    @ResponseBody
+    @RequestMapping(value = "/init", method = RequestMethod.GET)
+    public void init() {
+        printingProjectService.initAllPrintingProject();
+        courseStatisticService.initAllCourseStatistic();
+        printingProjectStatisticService.initAllPrintingProjectStatistic();
+    }
+
 }

+ 1 - 0
examcloud-core-print-starter/src/main/resources/security-exclusions.conf

@@ -1,4 +1,5 @@
 [][/][GET]
+[][/init][GET]
 [][/doc.html][GET]
 [][/swagger/ui/index][GET]
 [/swagger-resources][][GET]