-
Notifications
You must be signed in to change notification settings - Fork 0
chore: develop 변경사항 main 릴리즈 배포 #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
d77a4be
chore: AI Swagger 접근 보호 설정
deli-minju e046282
Merge pull request #58 from GACHI-Project/chore/#56-protect-ai-swagger
deli-minju d461503
refactor: 가정통신문 분석을 AI 서버 client로 전환
deli-minju 8038afd
refactor: AI 서버 client 안정성 보강
deli-minju e4958a2
Merge branch 'develop' into refac/#57-ai-server-client
deli-minju 5c94632
Merge pull request #59 from GACHI-Project/refac/#57-ai-server-client
deli-minju b444225
refactor: AI 서버 장애 시 분석 실패 정책 반영
deli-minju f7f37b2
fix: 가정통신문 분석 재시도 중복 실행 방지
deli-minju 1d0f578
feat: migration v11 추가
Hminkyung 13d7dbf
feat: user에 update 코드 추가
Hminkyung c6b6c4f
Merge pull request #61 from GACHI-Project/refac/#60-newsletter-ai-fai…
deli-minju 225f575
feat: AI 가정통신문 전체 분석 응답 저장 연동
deli-minju f0447a8
refactor: AI 분석 응답 저장 검증 보강
deli-minju aefbcde
chore: AI 컨테이너 OpenAI 환경변수 전달 설정 추가
deli-minju 79d16a0
Merge pull request #64 from GACHI-Project/feat/#63-newsletter-analyze…
deli-minju cdc7f61
feat: repository 코드 추가
Hminkyung 24aabae
feat: request dto 추가
Hminkyung 0b486e9
feat: controller 코드 추가 및 successcode 추가
Hminkyung 9273a8d
feat: errorcode 추가
Hminkyung 410b5a8
feat: auth dto에 회원가입 언어코드 추가
Hminkyung 91260a8
feat: auth service 로직에 자녀 색상코드 추가
Hminkyung ea40cb0
Merge branch 'develop' of https://github.com/GACHI-Project/GACHI-BE i…
Hminkyung 5c3cb36
feat: service 로직 추가- 사용자언어설정으로 받아와서 번역처리
Hminkyung bc93db6
feat: controller 코드 수정
Hminkyung 85ab4ae
feat: controller 코드 수정-parameter 받기 대신에 받아오기
Hminkyung 19d9f11
feat: description 추가
Hminkyung 00f0644
feat: migration 알림 여부 추가
Hminkyung 306a0ac
feat: user entity에 알림 설정 여부 추가
Hminkyung 678ca2f
feat: 알림 설정 변경 dto 추가
Hminkyung 8be2ce8
feat: 내 정보 조회 controller 추가
Hminkyung 3d0ebd3
feat: migration 파일 추가-사용자 알림설정
Hminkyung cb243b3
feat: spotlessapply 반영 및 description 추가
Hminkyung 5316f98
feat: AI 분석 결과 기반 캘린더 미리보기 자동 생성
deli-minju 812a4ba
fix: 캘린더 미리보기 저장 실패 격리
deli-minju b193aba
Merge pull request #67 from GACHI-Project/feat/#65-calendar-preview-f…
deli-minju 807188e
feat: 코드리뷰 반영
Hminkyung 23572b5
Merge branch 'develop' of https://github.com/GACHI-Project/GACHI-BE i…
Hminkyung ca1b3cc
fix: HttpClient 변경
Hminkyung 922291b
feat: AI 번역 추가로 진행
Hminkyung 84f5e12
feat: spotlessApply 반영
Hminkyung 8abed56
feat: 테스트 코드에 언어설정 추가
Hminkyung ecd502f
Merge pull request #66 from GACHI-Project/feat/#62-language-change
Hminkyung d1d889a
Merge branch 'main' into develop
deli-minju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # 가정통신문 AI 전체 분석 응답 저장 연동 | ||
|
|
||
| 이 문서는 BE가 AI 서버의 가정통신문 전체 분석 응답을 저장 모델에 반영하는 구현 결정을 정리한다. 상세 API 명세는 노션을 기준으로 관리한다. | ||
|
|
||
| ## 결정 사항 | ||
|
|
||
| - BE는 가정통신문 파이프라인의 AI 분석 단계에서 `POST /ai/newsletters/analyze`를 호출한다. | ||
| - AI 서버 응답의 top-level `title`, `summary`를 `newsletter.title`, `newsletter.summary`에 저장한다. | ||
| - AI 서버 응답의 `items`는 기존 checklist 저장 흐름에 연결한다. | ||
| - `dateCandidates` 요청 형식과 `items` 응답 형식은 기존 `extract-items` 계약을 유지한다. | ||
| - `meta`는 운영 보조 정보로 받고, 현재 BE 저장 모델에는 직접 저장하지 않는다. | ||
| - AI 서버 호출 실패 정책은 `docs/newsletter-ai-failure-policy.md`를 따른다. | ||
|
|
||
| ## 저장 정책 | ||
|
|
||
| - `title`: AI 응답 제목을 우선 저장한다. 빈 값이면 기존 BE fallback 제목을 사용한다. | ||
| - `summary`: AI 응답 요약을 우선 저장한다. 빈 값이면 기존 BE fallback 요약을 사용한다. | ||
| - `items`: `title`이 비어 있지 않은 항목만 checklist로 저장한다. | ||
| - `datetime`: TODO 저장 시 `targetDate`, `targetDateLabel` 생성에 사용한다. 파싱 실패 시 날짜 없이 저장한다. | ||
| - `dateStatus`: checklist 저장 모델에는 별도 컬럼이 없으므로 직접 저장하지 않는다. 단, `confirmed`이고 `datetime`이 파싱 가능한 항목은 calendar preview 생성 대상으로 사용한다. | ||
| - `calendar preview`: AI 분석으로 저장된 checklist/TODO ID와 확정 날짜를 묶어 Redis preview에 저장한다. `ambiguous`, `missing`, 날짜 파싱 실패 항목은 사용자가 확인해야 하므로 preview에 자동 포함하지 않는다. | ||
|
|
||
| ## 호환 정책 | ||
|
|
||
| - AI 서버의 `extract-items` baseline API는 유지하지만, BE 파이프라인은 `analyze`를 우선 사용한다. | ||
| - AI 서버가 `items`를 빈 배열로 반환해도 `title`, `summary`는 저장할 수 있다. | ||
| - 확정 날짜가 없는 분석 결과는 기존 Redis preview를 비워, 재분석 후 오래된 일정 후보가 남지 않게 한다. | ||
| - AI 서버 장애 시에는 OCR/번역/dateCandidates 스냅샷을 보존하고 newsletter 상태를 `FAILED`로 둔다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # AI 서버 장애 시 가정통신문 처리 정책 | ||
|
|
||
| 이 문서는 API 명세서가 아니라 BE가 장애 상황에서 어떤 상태와 데이터를 남길지 정한 운영 정책이다. | ||
| 상세 API 명세는 노션을 기준으로 관리한다. | ||
|
|
||
| ## 결정 사항 | ||
|
|
||
| - AI 서버 호출 실패 시 newsletter 상태는 `FAILED`로 둔다. | ||
| - 별도 부분 성공 상태는 이번 범위에서 추가하지 않는다. | ||
| - OCR, 정제 원문, 번역 결과, 날짜 후보는 가능한 범위까지 저장한다. | ||
| - AI 분석 결과에서 파생되는 제목, 요약, checklist, calendar event는 생성하지 않는다. | ||
| - 실패 원인 추적을 위해 `failureStage`, `failureReason`을 저장한다. | ||
| - 상태 조회 응답은 `FAILED`일 때 `canRetry=true`와 실패 단계를 반환한다. | ||
| - 사용자는 `POST /api/v1/newsletters/{newsletterId}/analysis/retry`로 같은 문서를 다시 분석할 수 있다. | ||
|
|
||
| ## 실패 시 저장 범위 | ||
|
|
||
| AI 서버 단계에서 실패하면 다음 데이터는 남긴다. | ||
|
|
||
| - `status = FAILED` | ||
| - `ocrText` | ||
| - `originalText` | ||
| - `translatedText` | ||
| - `dateCandidates` | ||
| - `failureStage = AI_SERVER` | ||
| - `failureReason` | ||
|
|
||
| 다음 데이터는 비워 둔다. | ||
|
|
||
| - `title` | ||
| - `summary` | ||
| - checklist | ||
| - calendar event | ||
|
|
||
| ## 재시도 정책 | ||
|
|
||
| 재시도는 `FAILED` 상태에서만 허용한다. | ||
|
|
||
| 재시도 요청이 들어오면 기존 checklist와 calendar event 파생 데이터를 삭제하고, newsletter 상태를 `PENDING`으로 되돌린 뒤 파이프라인을 다시 실행한다. | ||
|
|
||
| 자동 재시도 큐는 이번 범위에서 만들지 않는다. AI 서버 장애와 문서 입력 문제를 자동으로 구분하기 어렵고, 외부 API 비용과 장애 확산 위험이 있기 때문이다. | ||
|
|
||
| 추후 필요하면 `failureStage=AI_SERVER`인 건만 백오프 큐에 넣는 방식으로 확장한다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/gachi/be/domain/auth/service/AuthenticatedUserResolver.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
백엔드 기동이 AI 헬스체크에 하드 의존합니다.
Line 109-110에서
backend가ai의service_healthy를 필수로 기다리면, AI 장애 시 백엔드 재기동이 막혀 비-AI API까지 함께 중단될 수 있습니다. AI 실패는 앱 레이어에서 처리하고 컨테이너 기동 의존성은 분리하는 게 안전합니다.수정 제안
depends_on: db: condition: service_healthy redis: condition: service_healthy - ai: - condition: service_healthy📝 Committable suggestion
🤖 Prompt for AI Agents