Skip to content

Conversation

@ckdals4600
Copy link
Contributor

@ckdals4600 ckdals4600 commented Jan 6, 2026

관련 이슈

PR 설명

  • AI 서버(n8n webhook)와 연동하여 링크 최초 요약 및 재요약 기능을 수행하는 Feign Client를 구현하고 실제 서비스 로직에 적용함.
  • 기존 Mock 구현체를 RagSummaryClient로 대체하여 실제 외부 API 통신 환경을 구축함.

작업 내용

1. AI Summary Client 아키텍처 구현

  • 인터페이스 추상화: SummaryClient 인터페이스를 정의하여 구현체 교체가 용이하도록 설계.
  • Profile 분리:
    • test 프로파일: MockSummaryClient (테스트용 더미 데이터 반환).
    • !test 프로파일: RagSummaryClient (실제 Feign Client 호출).

2. Feign Client 및 통신 로직

  • Feign Interface: RagSummaryFeign 구현, n8n Webhook URL(ai.server.url)과 연동.
  • Endpoint 매핑:
    • 최초 요약: POST /webhook/summary-initial
    • 요약 재생성: POST /webhook/summary-resummarize
  • 응답 처리: n8n 응답이 JSON Array([{...}]) 형태로 내려오는 점을 고려하여 List<T> 형태로 수신 후 첫 번째 요소를 반환하도록 처리.

3. Facade 및 서비스 연동

  • LinkFacade: 링크 생성(createLink) 시 최초 요약 요청, 요약 재생성(recreateSummary) 시 재요약 요청 로직 연결.
  • Soft Fail 전략: 외부 AI 서버 통신 실패(Timeout, 5xx) 시 예외를 try-catch로 잡아 에러 로그를 남기고 null을 반환. 메인 트랜잭션(링크 생성 등)은 롤백되지 않도록 처리.

4. DTO 정의

  • Request: RagInitialSummaryReq, RagRegenerateSummaryReq
  • Response: RagInitialSummaryRes (요약문), RagRegenerateSummaryRes (신규 요약문 + 차이점)

@ckdals4600 ckdals4600 linked an issue Jan 6, 2026 that may be closed by this pull request
@ckdals4600 ckdals4600 requested review from Goder-0 and minibr January 6, 2026 05:13
@ckdals4600 ckdals4600 self-assigned this Jan 6, 2026
@ckdals4600 ckdals4600 changed the title feat: 요약 관련 AI 서버 연동 및 관련 로직 수정 (#166) 요약 관련 AI 서버 연동 Jan 6, 2026
@ckdals4600 ckdals4600 force-pushed the feature/#166-summary-regenrate-ai-connect branch from eae4609 to 660cf5a Compare January 6, 2026 08:04
@ckdals4600 ckdals4600 force-pushed the feature/#166-summary-regenrate-ai-connect branch from 660cf5a to a8236a4 Compare January 6, 2026 08:11
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

📊 코드 커버리지 리포트

Overall Project 88.98% -0.06% 🍏
Files changed 98.84% 🍏

File Coverage
LinkController.java 100% 🍏
MockSummaryClient.java 100% 🍏
LinkFacade.java 100% 🍏
SummaryCommandService.java 100% 🍏
SummaryService.java 100% 🍏
RagSummaryClient.java 97.53% -2.47% 🍏

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.

요약 AI 서버 연동

2 participants