Skip to content

AI 기반 면접 질문 생성, 답변 작성, 피드백 조회 관련 기능 구현#18

Merged
sgn07124 merged 17 commits intomainfrom
feat/question
Aug 7, 2025
Merged

AI 기반 면접 질문 생성, 답변 작성, 피드백 조회 관련 기능 구현#18
sgn07124 merged 17 commits intomainfrom
feat/question

Conversation

@sgn07124
Copy link
Owner

@sgn07124 sgn07124 commented Aug 6, 2025

User description

관련 이슈 (Related Issues)


PR Type

Enhancement, Tests


Description

  • GPT 연동 질문 생성·저장 기능 구현 및 DB 매핑

  • 비동기 피드백 생성 및 스케줄러 추가

  • API 엔드포인트와 Swagger 문서 추가

  • 다양한 단위 테스트 코드 작성


Diagram Walkthrough

flowchart LR
  A["POST /question/{category}"] --> B["QuestionService.createQuestion"]
  B --> C["QuestionMapper.insertQuestion"]
  D["POST /question/{id}/answer"] --> E["AnswerService.saveAnswer"]
  E --> F["QuestionMapper.updateStatus"]
  E --> G["AnswerMapper.insertAnswer"]
  E --> H["FeedbackService.saveFeedback (async)"]
  H --> I["GptService.callOpenAI"]
  I --> J["FeedbackMapper.insertFeedback"]
  K["POST /question/{id}/feedback"] --> L["FeedbackService.getFeedback"]
Loading

File Walkthrough

Relevant files

@sgn07124 sgn07124 self-assigned this Aug 6, 2025
@sgn07124 sgn07124 added the ✨ Feature 새로운 기능 추가 label Aug 6, 2025
@sgn07124 sgn07124 linked an issue Aug 6, 2025 that may be closed by this pull request
3 tasks
@sgn07124 sgn07124 added the ✅ Test 테스트 코드 추가 및 수정 label Aug 6, 2025
@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 93.68421% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...InsightPrep/global/gpt/service/GptServiceImpl.java 75.00% 2 Missing and 2 partials ⚠️
...n/question/scheduler/QuestionCleanupScheduler.java 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

PR Reviewer Guide 🔍

(Review updated until commit 9d68eaa)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

로깅 방식

System.out.println으로 GPT 응답 결과를 출력하고 있습니다. 프로덕션 코드에서는 Slf4j 로거를 사용해 레벨을 설정하고 불필요한 콘솔 출력은 제거해주세요.

FeedbackResponse gptResult = gptService.callOpenAI(PromptFactory.forFeedbackGeneration(question, userAnswer), 1000, 0.4, GptResponseType.FEEDBACK);
System.out.println(gptResult.getScore());
System.out.println(gptResult.getImprovement());
System.out.println(gptResult.getModelAnswer());
AnswerFeedback feedback = AnswerFeedback.builder()
@Async와 트랜잭션

@async 메서드에 @transactional을 함께 사용하면, 비동기 실행 시 트랜잭션이 정상 적용되지 않을 수 있습니다. 별도 트랜잭션 경계를 검토하거나 @async 분리 설정을 고려해주세요.

@Transactional
@Async
public void saveFeedback(Answer answer) {
프롬프트 공백

멀티라인 문자열에 포함된 들여쓰기/개행 공백이 의도치 않게 GPT 요청에 반영될 수 있습니다. trim() 처리나 템플릿 검증을 추가해 결과를 확인해주세요.

String systemPrompt = """
        당신은 예리하고 경험 많은 소프트웨어 개발자 면접관입니다. 
        지원자의 수준을 파악할 수 있는 깊이 있는 CS 면접 질문을 생성해야 합니다. 
        질문은 실무와 밀접하게 연관되며, 개념 이해를 바탕으로 응답자의 사고력을 평가할 수 있어야 합니다.
        응답은 질문 하나로만 구성되어야 하며, 질문 외의 설명이나 해설은 포함하지 마세요.
        아래 JSON 형식을 지켜서 응답해 주세요. 
        { \\"question\\": \\"...\\" }
        """;

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

Persistent review updated to latest commit 30f6b2e

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

Persistent review updated to latest commit 9d68eaa

@sgn07124 sgn07124 merged commit 4a03f5d into main Aug 7, 2025
3 checks passed
@sgn07124 sgn07124 deleted the feat/question branch August 7, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 4/5 ✨ Feature 새로운 기능 추가 ✅ Test 테스트 코드 추가 및 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI 기반 면접 질문 생성 및 답변 관련 기능 구현

1 participant