Skip to content

refactor(word): clean up word generation flow#341

Merged
SolfE merged 10 commits into
developfrom
codex/word-style-cleanup
Jun 25, 2026
Merged

refactor(word): clean up word generation flow#341
SolfE merged 10 commits into
developfrom
codex/word-style-cleanup

Conversation

@SolfE

@SolfE SolfE commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

word 생성 경로의 코드 스타일, 프롬프트 관리, 로그 기준, AI 사용량/비용 로깅을 정리했습니다.

Problem

word 패키지에 프롬프트 문자열과 생성 응답 조립 로직이 길게 섞여 있었고, 일부 로그 레벨과 AI 사용량/비용 로깅 위치가 운영 관측 기준과 맞지 않았습니다.

Solution

프롬프트를 리소스로 분리하고, word 응답 생성 흐름과 single-flight listener 종료 처리를 정리했습니다. 또한 Spring AI token usage API 변경에 맞춰 사용량 조회 메서드를 교체하고, Bedrock 비용 계산을 달러 기준으로 갱신했습니다.

Changes

  • word analysis prompt를 src/main/resources/prompts/word-analysis.md로 분리
  • WordAiService의 응답 생성/검증/로깅 흐름 정리
  • AI usage/cost 로그를 파싱 전에 남기도록 조정
  • Bedrock token cost constant와 Spring AI usage API 사용 정리
  • word controller/service 계층의 import, 로그 레벨, 불필요한 debug 로그 정리
  • Redis listener container shutdown lifecycle 정리

Example

API 계약 변경 없음. 기존 word 생성 요청/응답 형식은 유지됩니다.

Related Issues

없음

Validation

  • ./gradlew checkFormat test --tests com.linglevel.api.word.service.WordServiceTest --tests com.linglevel.api.word.service.WordVariantServiceTest --tests com.linglevel.api.word.controller.WordsAdminControllerTest

@SolfE SolfE marked this pull request as ready for review June 25, 2026 14:56
@SolfE SolfE merged commit 92a30d0 into develop Jun 25, 2026
1 check passed
@SolfE SolfE deleted the codex/word-style-cleanup branch June 25, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant