From 81cc767d1b3a5773fe715d6666b5042114bda7be Mon Sep 17 00:00:00 2001 From: RinRinPARK Date: Sun, 6 Oct 2024 23:18:51 +0900 Subject: [PATCH] =?UTF-8?q?Chore:=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C?= =?UTF-8?q?=20transactional=EC=82=AD=EC=A0=9C=20=EB=B0=8F=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=EC=97=90=20=ED=92=80=EC=9D=B4=20=EC=86=8C=EC=9A=94=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/com/swm_standard/phote/dto/ExamDtos.kt | 1 + .../kotlin/com/swm_standard/phote/service/ExamService.kt | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/swm_standard/phote/dto/ExamDtos.kt b/src/main/kotlin/com/swm_standard/phote/dto/ExamDtos.kt index 3eee484..6e00f98 100644 --- a/src/main/kotlin/com/swm_standard/phote/dto/ExamDtos.kt +++ b/src/main/kotlin/com/swm_standard/phote/dto/ExamDtos.kt @@ -38,6 +38,7 @@ data class ReadExamStudentResult( val userId: UUID, val name: String, val score: Int, + val time: Int, ) data class ReadExamResultsResponse( diff --git a/src/main/kotlin/com/swm_standard/phote/service/ExamService.kt b/src/main/kotlin/com/swm_standard/phote/service/ExamService.kt index bf115d1..c1d5000 100644 --- a/src/main/kotlin/com/swm_standard/phote/service/ExamService.kt +++ b/src/main/kotlin/com/swm_standard/phote/service/ExamService.kt @@ -56,7 +56,6 @@ class ExamService( @Value("\${openai.api.url}") lateinit var url: String - @Transactional(readOnly = true) fun readExamHistoryDetail(id: UUID): ReadExamHistoryDetailResponse { val examResult = examResultRepository.findByExamId(id) ?: throw NotFoundException(fieldName = "examResult") val responses = @@ -90,7 +89,6 @@ class ExamService( ) } - @Transactional(readOnly = true) fun readExamHistoryList(workbookId: UUID): List { val exams = examRepository.findAllByWorkbookId(workbookId) return exams.map { exam -> @@ -108,7 +106,6 @@ class ExamService( } } - @Transactional(readOnly = true) fun readExamResults(examId: UUID): ReadExamResultsResponse { val exam = examRepository.findById(examId).orElseThrow { NotFoundException(fieldName = "examId") } val examResults = examResultRepository.findAllByExamId(examId) @@ -117,7 +114,8 @@ class ExamService( ReadExamStudentResult( examResult.member.id, examResult.member.name, - examResult.totalCorrect + examResult.totalCorrect, + examResult.time, ) }