Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough코스 검색 문서 엔티티, 임베딩 생성/배치/오케스트레이션, 이벤트 기반 초기화, 임베딩 기반 추천 API 및 LLM 추천 이유 생성을 추가했습니다. Changes
Sequence DiagramsequenceDiagram
actor User
participant RecommendController as "RecommendController"
participant RecommendService as "CourseEmbeddingRecommendService"
participant EmbeddingService as "EmbeddingService"
participant DocRepo as "CourseSearchDocumentRepository"
participant CourseRepo as "CourseRepository"
participant ReasonSvc as "ReasonGenerationService"
User->>RecommendController: POST /api/recommend/courses/embedding (query, townId)
RecommendController->>RecommendService: recommendByQuery(query, townId, userId)
RecommendService->>EmbeddingService: embed(query)
RecommendService->>DocRepo: find active shared docs with embedding (town / parentTown)
DocRepo-->>RecommendService: documents with embeddings
Note over RecommendService, EmbeddingService: 코사인 유사도 계산 및 상위 K 선택
RecommendService->>CourseRepo: load courses with related data for selected IDs
RecommendService->>ReasonSvc: generateCourseReasons(query, userName, courseContexts)
ReasonSvc-->>RecommendService: reasons[]
RecommendService-->>RecommendController: EmbeddingCourseRecommendGetResponse
RecommendController-->>User: 200 OK (추천 코스 목록)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 분 Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌳이슈 번호
resolves #354
☀️어떻게 이슈를 해결했나요?
CourseSearchDocument엔티티를 신규 생성해 코스별 임베딩 벡터를 MySQL MEDIUMBLOB에 저장retrieval_text생성 (CourseRetrievalTextBuilder)CourseCreatedEvent→ 비공개 코스 제외 후 즉시 임베딩 / 수정 시 DIRTY → 매일 04:00 배치 재임베딩POST /api/recommend/courses/embedding호출 시 쿼리 임베딩 → 코사인 유사도 계산 → Top-3 선정 → LLM 추천 이유 생성parentTown = null)는 자식 동네 코스를 모두 포함해 검색POST /api/admin/courses/search-documents/initialize— INIT·FAILED 문서 즉시 임베딩 (테스트용)🗯️ PR 포인트
isShared = false인 비공개 코스는 이벤트 리스너에서 조기 반환으로 임베딩 생략embedInChunks/splitIntoChunks네이밍으로 청크 분할 목적을 명시ReasonGenerationService에CourseContext+generateCourseReasons추가 — 장소 추천 이유 생성과 대칭 구조 유지AdminCourseController에 추가해 어드민 인증 체계 재사용Summary by CodeRabbit