Conversation
joonamin
commented
Feb 9, 2026
- 충돌 해결 후 합병예정
* refactor(security): update permitted endpoints and remove ChatController - Updated SecurityConfig to restrict access by removing the chat endpoint from the permitted list. - Deleted ChatController as it is no longer needed in the application. * refactor(quiz): rename quiz class and delete quiz choice * feat: add & fix mock data * feat: rebase 마무리 * feat(data loader): add scene rank data * fix: accept review --------- Co-authored-by: DaehyeonKim <qwertypotter@gachon.ac.kr>
* refactor(security): update permitted endpoints and remove ChatController - Updated SecurityConfig to restrict access by removing the chat endpoint from the permitted list. - Deleted ChatController as it is no longer needed in the application. * feat(quiz): get quiz list * fix: order by quiz id * fix(quiz): 정답을 프론트로 내려주지 않도록 수정, 객관식 채점 시 정답 올바르게 파싱하도록 수정 --------- Co-authored-by: DaehyeonKim <qwertypotter@gachon.ac.kr>
Summary of ChangesHello @joonamin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 풀 리퀘스트는 퀴즈 기능을 백엔드 시스템에 통합하고 초기 데이터 로딩 방식을 개선하는 데 중점을 둡니다. 새로운 퀴즈 관련 엔드포인트, 서비스 로직 및 데이터 모델이 추가되었으며, 기존 데이터 로더는 퀴즈와 통계 데이터를 외부 JSON 파일에서 동적으로 로드하도록 확장되었습니다. 또한, 특정 채팅 엔드포인트에 대한 보안 요구 사항이 강화되었습니다. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
이번 PR은 퀴즈 기능을 추가하고 관련 데이터 로딩 방식을 개선하는 중요한 변경사항을 포함하고 있습니다. 전반적으로 코드 구조가 잘 잡혀있고, 특히 DataLoader를 리팩토링하여 JSON 파일로부터 초기 데이터를 로드하도록 변경한 점은 유지보수성 측면에서 매우 훌륭한 개선입니다. 새로운 퀴즈 관련 API 엔드포인트와 서비스 로직도 잘 구현되었습니다. 다만, QuizGradingService에서 사용자의 퀴즈 진행 상황을 업데이트하는 로직에 데이터 정합성을 해칠 수 있는 잠재적인 버그를 발견했습니다. 해당 부분에 대한 리뷰 코멘트를 남겼으니 확인 후 수정 부탁드립니다.
| QuizUserProgress updated = QuizUserProgress.builder() | ||
| .id(progress.getId()) | ||
| .user(progress.getUser()) | ||
| .scene(progress.getScene()) | ||
| .lastQuizId(quiz.getId()) | ||
| .totalQuestions(progress.getTotalQuestions() + 1) | ||
| .success(correct ? progress.getSuccess() + 1 : progress.getSuccess()) | ||
| .failure(correct ? progress.getFailure() : progress.getFailure() + 1) | ||
| .isComplete(progress.isComplete()) | ||
| .solveTime(progress.getSolveTime()) | ||
| .build(); | ||
| .id(progress.getId()) | ||
| .user(progress.getUser()) | ||
| .scene(progress.getScene()) | ||
| .lastQuizId(quiz.getId()) | ||
| .totalQuestions(progress.getTotalQuestions() + 1) | ||
| .success(correct ? progress.getSuccess() + 1 : progress.getSuccess()) | ||
| .failure(correct ? progress.getFailure() : progress.getFailure() + 1) | ||
| .isComplete(progress.isComplete()) | ||
| .solveTime(progress.getSolveTime()) | ||
| .build(); |
There was a problem hiding this comment.
퀴즈 채점 시 진행 상황을 업데이트하는 로직에서 totalQuestions 필드가 정답/오답 여부와 관계없이 항상 1씩 증가하고 있습니다. totalQuestions는 해당 씬의 전체 퀴즈 개수를 의미해야 하므로, 채점 시마다 변경되어서는 안 됩니다. 현재 로직은 사용자가 문제를 풀 때마다 전체 문항 수가 늘어나는 것처럼 데이터를 기록하여, 데이터 정합성에 문제가 발생합니다. 이는 프로젝트의 핵심 원칙인 **데이터 정합성(Consistency)**에 위배됩니다.
QuizService의 getSceneQuizzes 메소드에서는 QuizUserProgress가 처음 생성될 때 전체 퀴즈 개수로 올바르게 초기화하고 있습니다. 이 값을 그대로 유지해야 합니다.
따라서 .totalQuestions(progress.getTotalQuestions() + 1) 부분에서 + 1을 제거하여 기존 값을 유지하도록 수정해야 합니다.
| QuizUserProgress updated = QuizUserProgress.builder() | |
| .id(progress.getId()) | |
| .user(progress.getUser()) | |
| .scene(progress.getScene()) | |
| .lastQuizId(quiz.getId()) | |
| .totalQuestions(progress.getTotalQuestions() + 1) | |
| .success(correct ? progress.getSuccess() + 1 : progress.getSuccess()) | |
| .failure(correct ? progress.getFailure() : progress.getFailure() + 1) | |
| .isComplete(progress.isComplete()) | |
| .solveTime(progress.getSolveTime()) | |
| .build(); | |
| .id(progress.getId()) | |
| .user(progress.getUser()) | |
| .scene(progress.getScene()) | |
| .lastQuizId(quiz.getId()) | |
| .totalQuestions(progress.getTotalQuestions() + 1) | |
| .success(correct ? progress.getSuccess() + 1 : progress.getSuccess()) | |
| .failure(correct ? progress.getFailure() : progress.getFailure() + 1) | |
| .isComplete(progress.isComplete()) | |
| .solveTime(progress.getSolveTime()) | |
| .build(); | |
| QuizUserProgress updated = QuizUserProgress.builder() | |
| .id(progress.getId()) | |
| .user(progress.getUser()) | |
| .scene(progress.getScene()) | |
| .lastQuizId(quiz.getId()) | |
| .totalQuestions(progress.getTotalQuestions()) | |
| .success(correct ? progress.getSuccess() + 1 : progress.getSuccess()) | |
| .failure(correct ? progress.getFailure() : progress.getFailure() + 1) | |
| .isComplete(progress.isComplete()) | |
| .solveTime(progress.getSolveTime()) | |
| .build(); |
References
- 이 프로젝트는 데이터 정합성(Consistency)을 최우선으로 고려합니다. 제안된 변경은
totalQuestions필드의 값을 잘못 증가시켜 데이터의 정합성을 해치므로 수정이 필요합니다. (link)
|
gemini review 반영해주세욤 |
|
이거 +1 성공여부 상관없이 증가하도록 작성하신거 의도하신건가요?? 아니면 그대로 리뷰반영하면되나요?? 흐름 한번만 더 리마인드해주시겠어요? |
|
채원님 이거 quiz 관련해서 로직 수정하다 보니까 API 단에서도 변경되어야할 지점들이 보입니다. |