|
|
@@ -13,7 +13,6 @@ import nju.seec.helper.util.enums.QuizState;
|
|
|
import nju.seec.helper.util.enums.UserType;
|
|
|
import nju.seec.helper.vo.quiz.QuizStudentAnswerVO;
|
|
|
import nju.seec.helper.vo.quiz.QuizVO;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.web.PageableDefault;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -44,9 +43,9 @@ public class QuizController {
|
|
|
@Auth(roles = {UserType.TEACHER, UserType.STUDENT}, message = "获得测试列表")
|
|
|
@GetMapping("/slide/{slideId}")
|
|
|
public PageResponse<QuizVO> getQuizzesBySlide(LoginUser user,
|
|
|
- @PathVariable Long slideId,
|
|
|
- @RequestParam(required = false, defaultValue = "") String key,
|
|
|
- @PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
+ @PathVariable Long slideId,
|
|
|
+ @RequestParam(required = false, defaultValue = "") String key,
|
|
|
+ @PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
switch (user.getType()) {
|
|
|
case TEACHER:
|
|
|
return PageResponse.of(quizService.teacherGetQuizzesBySlide(user, slideId, key, pageable));
|
|
|
@@ -62,10 +61,10 @@ public class QuizController {
|
|
|
*/
|
|
|
@Auth(roles = UserType.STUDENT, message = "获取测试列表")
|
|
|
@GetMapping("/state")
|
|
|
- public PageResponse<QuizVO> studentGetQuizzesByState(LoginUser user,
|
|
|
- QuizState state,
|
|
|
- @RequestParam(required = false, defaultValue = "") String key,
|
|
|
- @PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
+ public PageResponse<QuizVO> getQuizzesByState(LoginUser user,
|
|
|
+ QuizState state,
|
|
|
+ @RequestParam(required = false, defaultValue = "") String key,
|
|
|
+ @PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
switch (user.getType()) {
|
|
|
case STUDENT:
|
|
|
return PageResponse.of(quizService.studentGetQuizzesByState(user, state, key, pageable));
|