|
@@ -18,15 +18,17 @@ import com.gyee.exam.modules.course.dto.request.UserCourseReqDTO;
|
|
import com.gyee.exam.modules.course.dto.response.UserCourseRespDTO;
|
|
import com.gyee.exam.modules.course.dto.response.UserCourseRespDTO;
|
|
import com.gyee.exam.modules.course.entity.Course;
|
|
import com.gyee.exam.modules.course.entity.Course;
|
|
import com.gyee.exam.modules.course.service.CourseService;
|
|
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.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -44,6 +46,12 @@ public class CourseController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private CourseService baseService;
|
|
private CourseService baseService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TmplService tmplService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private QuService quService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 添加或修改
|
|
* 添加或修改
|
|
* @param reqDTO
|
|
* @param reqDTO
|
|
@@ -150,4 +158,28 @@ public class CourseController extends BaseController {
|
|
IPage<UserCourseRespDTO> page = baseService.userPaging(reqDTO);
|
|
IPage<UserCourseRespDTO> page = baseService.userPaging(reqDTO);
|
|
return super.success(page);
|
|
return super.success(page);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 统计课程,题目、试卷总数
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "统计总课程数")
|
|
|
|
+ @GetMapping("/ctt-total")
|
|
|
|
+ public ApiRest courseAllTotal() {
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|