Feat/147/book#148
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces AI-enriched book data and automatic tag mapping. New fields (shortIntro, aiTasteComment, tasteAnalysis, tableOfContents) are added to the Books entity and DTOs. BookEnrichmentService generates enriched content; BookTagAutoMappingService auto-assigns tags using weighted keyword scoring. BookQueryServiceImpl orchestrates these services, and converters/DTOs updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant QueryService as BookQueryServiceImpl
participant TagMapper as BookTagAutoMappingService
participant Enrichment as BookEnrichmentService
participant Converter as BookConverter
participant DB as Database
Client->>QueryService: getBookDetail(bookId)
QueryService->>DB: Load Book entity
DB-->>QueryService: Book data
Note over QueryService: Tag Auto-Mapping
QueryService->>TagMapper: autoMapTags(book)
TagMapper->>DB: Query existing tags
DB-->>TagMapper: Tags & keyword map
TagMapper->>TagMapper: Calculate weighted scores<br/>(title: 3pts, desc: 1pt)
TagMapper->>DB: Persist BookTags associations
DB-->>TagMapper: Success
TagMapper-->>QueryService: Complete
Note over QueryService: AI Enrichment
QueryService->>Enrichment: enrichBookInfo(bookId)
Enrichment->>DB: Reload Book with tags
DB-->>Enrichment: Book + tags
Enrichment->>Enrichment: Generate shortIntro<br/>aiTasteComment<br/>tasteAnalysis<br/>tableOfContents
Enrichment->>DB: updateEnrichedInfo()
DB-->>Enrichment: Updated
Enrichment-->>QueryService: Complete
Note over QueryService: Transform to Response
QueryService->>Converter: toBookDetailResponse(book)
Converter->>Converter: Parse JSON fields<br/>with null checks
Converter-->>QueryService: BookDetailResponse
QueryService-->>Client: Enriched book details
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches
🧪 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 |
Summary by CodeRabbit
New Features
Refactor