Skip to content

Commit

Permalink
Merge pull request #108 from 22caps/dev
Browse files Browse the repository at this point in the history
dev -> main
  • Loading branch information
GiHoo authored Oct 10, 2024
2 parents 07c92e6 + 6ff6e15 commit fbe926c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public interface ProblemService {
ProblemHintResponseDto getHintByQuestion(Long problemId);

Problem getProblemById(Long problemId);

ProblemResponseDto getGrammarProblem();
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,13 @@ public Problem getProblemById(Long problemId) {
.orElseThrow(
() -> ProblemExistsException.of(ProblemErrorCode.PROBLEM_IS_NOT_EXISTS));
}

@Override
public ProblemResponseDto getGrammarProblem() {
return ProblemResponseDto.of(
problemRepository.getProblemByProblemType(ProblemType.GRAMMAR)
.orElseThrow(
() -> ProblemExistsException.of(
ProblemErrorCode.PROBLEM_IS_NOT_EXISTS)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,12 @@ public ProblemResponseDto getProblem(
public ProblemHintResponseDto getHint(@PathVariable("problemId") Long problemId) {
return problemService.getHintByQuestion(problemId);
}

@GetMapping("/grammar}")
@Operation(summary = "문법 문제 조회", description = "gpt 플러그인용 테스트 API")
@ApiResponse(responseCode = "200", description = "문제 조회 성공")
public ProblemResponseDto getProblem(
) {
return problemService.getGrammarProblem();
}
}

0 comments on commit fbe926c

Please sign in to comment.