-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Quiz, Video Favorite 관련 API 구현 (#74)
- Loading branch information
Showing
32 changed files
with
1,128 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
== 퀴즈 결과 API | ||
:source-highlighter: highlightjs | ||
|
||
--- | ||
=== 퀴즈 결과 조회 (GET /quizzes/result) | ||
==== | ||
operation::quiz-controller-test/get-quiz-results[snippets="http-request,query-parameters,http-response,response-fields"] | ||
==== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,6 @@ public enum AccessType { | |
PROFESSOR, | ||
STUDENT, | ||
COMPANY, | ||
ALL | ||
ALL, | ||
OPTIONAL | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/com/scg/stop/video/controller/QuizController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.scg.stop.video.controller; | ||
|
||
import com.scg.stop.auth.annotation.AuthUser; | ||
import com.scg.stop.user.domain.AccessType; | ||
import com.scg.stop.user.domain.User; | ||
import com.scg.stop.video.dto.response.UserQuizResultResponse; | ||
import com.scg.stop.video.service.QuizService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.web.PageableDefault; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/quizzes") | ||
public class QuizController { | ||
private final QuizService quizService; | ||
|
||
@GetMapping("/result") | ||
public ResponseEntity<Page<UserQuizResultResponse>> getQuizResults( | ||
@RequestParam(value = "year", required = false) Integer year, | ||
@AuthUser(accessType = {AccessType.ADMIN}) User user, | ||
@PageableDefault(page = 0, size = 10) Pageable pageable | ||
) { | ||
Page<UserQuizResultResponse> responses = quizService.getQuizResults(year, pageable); | ||
return ResponseEntity.status(HttpStatus.OK).body(responses); | ||
} | ||
} |
Oops, something went wrong.