Skip to content

Commit 4d549e6

Browse files
committed
feat: qa용 퀴즈 전체 삭제 API를 개발한다
1 parent 9b5c6d8 commit 4d549e6

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.gitanimals.quiz.controller
2+
3+
import org.gitanimals.quiz.domain.context.QuizSolveContextRepository
4+
import org.springframework.web.bind.annotation.DeleteMapping
5+
import org.springframework.web.bind.annotation.RequestParam
6+
import org.springframework.web.bind.annotation.RestController
7+
8+
@RestController
9+
class QuizQaController(
10+
private val quizSolveContextRepository: QuizSolveContextRepository,
11+
) {
12+
13+
@DeleteMapping("/quizs/qa/context")
14+
fun deleteQuizContext(
15+
@RequestParam("userId") userId: Long,
16+
) = quizSolveContextRepository.deleteByUserId(userId)
17+
}

src/main/kotlin/org/gitanimals/quiz/domain/context/QuizSolveContextRepository.kt

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ interface QuizSolveContextRepository : JpaRepository<QuizSolveContext, Long> {
2525
id: Long,
2626
userId: Long,
2727
): QuizSolveContext?
28+
29+
fun deleteByUserId(userId: Long)
2830
}

0 commit comments

Comments
 (0)