-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge: remote-tracking branch 'origin' into seyeon/swm-106
- Loading branch information
Showing
20 changed files
with
520 additions
and
88 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
41 changes: 41 additions & 0 deletions
41
src/main/kotlin/com/swm_standard/phote/controller/ExamController.kt
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,41 @@ | ||
package com.swm_standard.phote.controller | ||
|
||
import com.swm_standard.phote.common.responsebody.BaseResponse | ||
import com.swm_standard.phote.dto.ReadExamHistoryDetailResponse | ||
import com.swm_standard.phote.dto.ReadExamHistoryListResponse | ||
import com.swm_standard.phote.service.ExamService | ||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import org.springframework.web.bind.annotation.RestController | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import java.util.UUID | ||
|
||
@RestController | ||
@RequestMapping("/api") | ||
@Tag(name = "Exam", description = "Exam API Document") | ||
class ExamController( | ||
private val examService: ExamService | ||
) { | ||
@Operation(summary = "readExamHistoryDetail", description = "문제풀이 기록 상세조회") | ||
@SecurityRequirement(name = "bearer Auth") | ||
@GetMapping("/exam/{id}") | ||
fun readExamHistoryDetail( | ||
@PathVariable( | ||
required = true | ||
) id: UUID | ||
): BaseResponse<ReadExamHistoryDetailResponse> = | ||
BaseResponse(msg = "문제풀이 기록 상세조회 성공", data = examService.readExamHistoryDetail(id)) | ||
|
||
@Operation(summary = "readExamHistoryList", description = "문제풀이 기록 리스트 조회") | ||
@SecurityRequirement(name = "bearer Auth") | ||
@GetMapping("/exams/{workbookId}") | ||
fun readExamHistoryList( | ||
@PathVariable( | ||
required = true | ||
) workbookId: UUID | ||
): BaseResponse<List<ReadExamHistoryListResponse>> = | ||
BaseResponse(msg = "문제풀이 기록 리스트 조회 성공", data = examService.readExamHistoryList(workbookId)) | ||
} |
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,30 @@ | ||
package com.swm_standard.phote.dto | ||
|
||
import com.swm_standard.phote.entity.Category | ||
import java.util.UUID | ||
|
||
data class ReadExamHistoryDetail( | ||
val statement: String, | ||
val options: List<String>?, | ||
val image: String?, | ||
val category: Category, | ||
val answer: String, | ||
val submittedAnswer: String, | ||
val isCorrect: Boolean, | ||
val sequence: Int | ||
) | ||
|
||
data class ReadExamHistoryDetailResponse( | ||
val id: UUID, | ||
val totalCorrect: Int, | ||
val time: Int, | ||
val questions: List<ReadExamHistoryDetail> | ||
) | ||
|
||
data class ReadExamHistoryListResponse( | ||
val examId: UUID, | ||
val totalQuantity: Int, | ||
val totalCorrect: Int, | ||
val time: Int, | ||
val sequence: Int | ||
) |
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
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
9 changes: 9 additions & 0 deletions
9
src/main/kotlin/com/swm_standard/phote/repository/ExamRepository.kt
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,9 @@ | ||
package com.swm_standard.phote.repository | ||
|
||
import com.swm_standard.phote.entity.Exam | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import java.util.UUID | ||
|
||
interface ExamRepository : JpaRepository<Exam, UUID> { | ||
fun findAllByWorkbookId(workbookId: UUID): List<Exam> | ||
} |
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
Oops, something went wrong.