[Feat] 자소서 분석 API 구현 (#24)#61
Conversation
- 자소서 분석 실행 API 추가 - 자소서 분석 결과 조회 API 추가 - 저장된 문항 답변과 공고 정보를 기반으로 LLM 분석 프롬프트 구성 - LLM JSON 응답을 Analysis 및 QuestionAnalysis 엔티티로 저장 - 재분석 시 기존 분석 결과와 문항 분석 결과를 교체하도록 처리 - 분석 완료 시 MockApply 상태를 COMPLETED로 변경 - 원문에 존재하지 않는 분석 sentence는 저장하지 않도록 검증 - start/end index를 서버에서 answer 기준으로 계산 - 점수를 0~100 범위로 보정 - 분석 결과 응답 DTO 및 LLM 응답 DTO 추가 - 분석 결과 없음 예외 코드 추가 - 로컬 실행 기본 프로필을 dev로 설정하고 dev JWT 기본값 추가 - 자소서 분석 서비스 테스트 추가
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR introduces a complete AI-powered analysis feature for mock job applications. It enables users to request AI-generated feedback on their self-introduction answers against job postings, persists analysis results with question-level insights, and provides endpoints to retrieve prior analyses. The feature integrates with OpenAI using structured output, validates user ownership, and includes comprehensive test coverage. ChangesAI-Powered Mock Application Analysis
Sequence DiagramsequenceDiagram
participant User
participant AnalysisController
participant AnalysisService
participant AnalysisAiClient
participant OpenAIClient
participant Database
User->>AnalysisController: POST /api/mock-applies/{id}/analysis
AnalysisController->>AnalysisService: analyze(user, mockApplyId)
AnalysisService->>AnalysisService: Load & authorize MockApply
AnalysisService->>AnalysisService: Gather questions & validate answers
AnalysisService->>AnalysisAiClient: analyze(jobPosting, questions)
AnalysisAiClient->>OpenAIClient: responses().create(prompt, expectedType)
OpenAIClient-->>AnalysisAiClient: AnalysisLlmResponse
AnalysisAiClient-->>AnalysisService: AnalysisLlmResponse
AnalysisService->>Database: Delete prior QuestionAnalysis
AnalysisService->>Database: Delete prior Analysis
AnalysisService->>Database: Save new Analysis & QuestionAnalysis
AnalysisService->>Database: Update MockApply status to COMPLETED
AnalysisService-->>AnalysisController: AnalysisResponse
AnalysisController-->>User: ApiResponse.onSuccess(AnalysisResponse)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
✨ 어떤 이유로 PR를 하셨나요?
📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요
📸 작업 화면 스크린샷
🚨 관련 이슈 번호 [#24]
Summary by CodeRabbit
New Features
Tests
Chores