Skip to content

Commit

Permalink
Chore: 불필요한 transactional삭제 및 응답에 풀이 소요 시간 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
RinRinPARK committed Oct 6, 2024
1 parent 07890f1 commit 81cc767
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/com/swm_standard/phote/dto/ExamDtos.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ data class ReadExamStudentResult(
val userId: UUID,
val name: String,
val score: Int,
val time: Int,
)

data class ReadExamResultsResponse(
Expand Down
6 changes: 2 additions & 4 deletions src/main/kotlin/com/swm_standard/phote/service/ExamService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -90,7 +89,6 @@ class ExamService(
)
}

@Transactional(readOnly = true)
fun readExamHistoryList(workbookId: UUID): List<ReadExamHistoryListResponse> {
val exams = examRepository.findAllByWorkbookId(workbookId)
return exams.map { exam ->
Expand All @@ -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)
Expand All @@ -117,7 +114,8 @@ class ExamService(
ReadExamStudentResult(
examResult.member.id,
examResult.member.name,
examResult.totalCorrect
examResult.totalCorrect,
examResult.time,
)
}

Expand Down

0 comments on commit 81cc767

Please sign in to comment.