Skip to content

리팩토링: ExternalAiClientImpl 책임별 클라이언트 분리 - #18

Merged
config25 merged 1 commit into
mainfrom
refactor/external-ai-client-split
Apr 7, 2026
Merged

리팩토링: ExternalAiClientImpl 책임별 클라이언트 분리#18
config25 merged 1 commit into
mainfrom
refactor/external-ai-client-split

Conversation

@config25

@config25 config25 commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

1개 클래스(293줄)에 GPT/YOLO/LAMA/S3 4개 외부 시스템이 섞여있던 구조를 시스템별 클라이언트로 분리하고, 기존 클래스는 thin composite로 슬림화.

  • GptVisionClient: GPT-4 Vision 분석/비교 + 응답 파싱
  • YoloDetectionClient: 어지러운 영역 감지
  • LamaInpaintClient: 인페인팅 + 전용 RestTemplate(multipart)
  • S3ImageStore: AI 파이프라인 전용 S3 헬퍼(다운로드/Base64/업로드)
  • ExternalAiClientImpl: 293줄 → 50줄 thin composite로 위임

도메인 인터페이스(ExternalAiClient)는 미변경 → 도메인 영향 없음.

부수 개선:

  • requestCompareAnalysis의 catch(Exception)이 OpenAI 429를 묵살하던 사일런트 버그 수정 → AI_RATE_LIMIT_EXCEEDED로 일관 처리
  • 사용되지 않던 @value 필드 3개 제거(openai.api.url, openai.api.url.image, openai.api.key)

1개 클래스(293줄)에 GPT/YOLO/LAMA/S3 4개 외부 시스템이 섞여있던 구조를
시스템별 클라이언트로 분리하고, 기존 클래스는 thin composite로 슬림화.

- GptVisionClient: GPT-4 Vision 분석/비교 + 응답 파싱
- YoloDetectionClient: 어지러운 영역 감지
- LamaInpaintClient: 인페인팅 + 전용 RestTemplate(multipart)
- S3ImageStore: AI 파이프라인 전용 S3 헬퍼(다운로드/Base64/업로드)
- ExternalAiClientImpl: 293줄 → 50줄 thin composite로 위임

도메인 인터페이스(ExternalAiClient)는 미변경 → 도메인 영향 없음.

부수 개선:
- requestCompareAnalysis의 catch(Exception)이 OpenAI 429를 묵살하던
  사일런트 버그 수정 → AI_RATE_LIMIT_EXCEEDED로 일관 처리
- 사용되지 않던 @value 필드 3개 제거(openai.api.url, openai.api.url.image, openai.api.key)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@config25 config25 self-assigned this Apr 7, 2026
@config25
config25 merged commit 7127d3c into main Apr 7, 2026
1 check passed
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