배경
뉴스에서 모르는 단어를 클릭하여 수집하고, 기존 Vocabulary 도메인과 연동하여 통합 학습이 가능하도록 합니다. 단어 하이라이트 기능으로 난이도 높은 단어를 시각적으로 표시합니다.
수용 기준(AC)
디자인/계약 링크
단어 하이라이트 로직:
1. 사용자 레벨 확인 (BEGINNER/INTERMEDIATE/ADVANCED)
2. 기사 내 keywords에서 사용자 레벨보다 높은 단어 추출
3. 해당 단어들에 highlightWords 필드로 마킹
4. 프론트엔드에서 하이라이트 렌더링
DynamoDB 스키마 - NewsWordCollect:
PK: USER#{userId}#NEWS
SK: WORD#{word}#{articleId}
GSI1-PK: USER#{userId}#NEWS_WORDS
GSI1-SK: {collectedAt}
Attributes:
- word, meaning, context (문맥 문장)
- articleId (출처), collectedAt
- syncedToVocab (Boolean), vocabUserWordId
Vocabulary 연동 흐름:
NewsWordCollect → UserWord (source: "NEWS")
├─ sourceId: articleId
└─ context: 원문 문맥
API Request - POST /news/{articleId}/words:
{
"word": "revenue",
"context": "The company's revenue increased by 20%."
}
API Response - GET /news/{articleId}/words/{word}:
{
"word": "revenue",
"meaning": "수익, 매출",
"pronunciation": "/ˈrevənjuː/",
"examples": ["Annual revenue exceeded expectations."],
"level": "INTERMEDIATE",
"audioUrl": "https://..."
}
구현 메모/리스크
- 기존 Word 테이블과 매칭 시도, 없으면 Bedrock으로 생성
- Vocabulary UserWord 생성 시 source="NEWS" 명시
- 단어 뜻은 캐싱하여 반복 조회 비용 절감
연결된 Epic
#384
배경
뉴스에서 모르는 단어를 클릭하여 수집하고, 기존 Vocabulary 도메인과 연동하여 통합 학습이 가능하도록 합니다. 단어 하이라이트 기능으로 난이도 높은 단어를 시각적으로 표시합니다.
수용 기준(AC)
디자인/계약 링크
단어 하이라이트 로직:
DynamoDB 스키마 - NewsWordCollect:
Vocabulary 연동 흐름:
API Request - POST /news/{articleId}/words:
{ "word": "revenue", "context": "The company's revenue increased by 20%." }API Response - GET /news/{articleId}/words/{word}:
{ "word": "revenue", "meaning": "수익, 매출", "pronunciation": "/ˈrevənjuː/", "examples": ["Annual revenue exceeded expectations."], "level": "INTERMEDIATE", "audioUrl": "https://..." }구현 메모/리스크
연결된 Epic
#384