Ver código fonte

增加总课程数量、题目数量、试卷数整合

wangchangsheng 2 anos atrás
pai
commit
0c4e203256

+ 24 - 4
exam-06173-api/src/main/java/com/gyee/exam/modules/course/controller/CourseController.java

@@ -18,6 +18,8 @@ import com.gyee.exam.modules.course.dto.request.UserCourseReqDTO;
 import com.gyee.exam.modules.course.dto.response.UserCourseRespDTO;
 import com.gyee.exam.modules.course.entity.Course;
 import com.gyee.exam.modules.course.service.CourseService;
+import com.gyee.exam.modules.qu.service.QuService;
+import com.gyee.exam.modules.tmpl.service.TmplService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.shiro.authz.annotation.Logical;
@@ -25,6 +27,9 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
 * <p>
 * 课程信息控制器
@@ -41,6 +46,12 @@ public class CourseController extends BaseController {
     @Autowired
     private CourseService baseService;
 
+    @Autowired
+    private TmplService tmplService;
+
+    @Autowired
+    private QuService quService;
+
     /**
     * 添加或修改
     * @param reqDTO
@@ -150,14 +161,23 @@ public class CourseController extends BaseController {
 
 
     /**
-     * 统计课程数
+     * 统计课程,题目、试卷总
      * @return
      */
     @ApiOperation(value = "统计总课程数")
-    @GetMapping("/course-total")
+    @GetMapping("/ctt-total")
     public ApiRest courseAllTotal() {
-        int total = baseService.courseAllTotal();
-        return super.success(total);
+        Map map = new HashMap<>();
+
+        int coursetotal = baseService.courseAllTotal();
+        int tmpltotal = tmplService.tmplTotal();
+        int titletotal = quService.titleTotal();
+
+        map.put("course",coursetotal);
+        map.put("tmpl",tmpltotal);
+        map.put("title",titletotal);
+
+        return super.success(map);
     }