-
Notifications
You must be signed in to change notification settings - Fork 0
feat(report): 주간 리포트 도메인 구현 #64
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
Conversation
이번 주의 범위 반환, 주어진 날짜가 속한 주의 범위 반환
…to 구현 주간 리포트 생성 프롬프트의 입력값 생성에 활용
프롬프팅을 통해 OpenAI API를 호출하여 주간 리포트를 생성
이번 주의 주간 리포트가 있으면 반환하고, 없으면 PENDING으로 생성하는 서비스
주간 리포트는 저번주의 기록을 통해서 생성하는 것
저번 주에 4회 이상 작성했어야 생성 가능
트랜잭션 안에서 event publish하도록 수정, weekly_reports 테이블에서 discovered, good, improved 컬럼의 not null 제약 제거 등
프롬프트와 temperature는 개발 서버와 동일하게 고정, 질문과 답변만 입력받도록 수정
| } | ||
|
|
||
| @GetMapping("/{id}") | ||
| @PermitAll |
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.
이 부분 PermitAll로 하신 이유가 따로 있으신가요?
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.
단순히 조회용이라서 열어두긴 했는데, 인증을 걸어두도록 하겠습니다!
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.
수정 완료했습니다!
📝 요약(Summary)
① weekly_reports 테이블 생성 및 WeeklyReport 엔티티 구현
PENDING, COMPLETED, FAILED, IN_PROGRESS② 주간 리포트 생성 기능 구현
주간 리포트 생성의 경우에는 여러 가능성을 고려하여(생성 시간이 오래 걸리는 gpt-5-mini 모델의 채택 등) 비동기 형식으로 구현하였습니다.
전체 흐름 요약:
1. 요청 시점(동기, 짧은 트랜잭션)
DailyReport4회 이상 완료)WeeklyReport(PENDING)생성CrystalLog(PENDING)기록{ reportId, status=PENDING }반환2. 커밋 이후 비동기 처리
@TransactionalEventListener(AFTER_COMMIT)+@Async로 LLM 호출3. 결과 확정(짧은 트랜잭션)
COMPLETED, 크리스탈 로그 확정FAILED, 크리스탈 환불 + 로그 처리유틸 & 헬퍼 클래스들
WeekRangeCalculator: 저번 주의 범위 반환, 주어진 날짜가 속한 주의 범위 반환, 특정 달의 몇 주차인지 반환WeeklyPromptLoader및 구현체들: 프롬프트를 로드WeeklyEntriesAssembler: 주간 리포트 생성 프롬프트의 입력값 생성에 활용WeeklyReportLlmClient: 주간 리포트를 프롬프팅을 통해 생성WeeklyReportGenerationListener: 비동기 리스너③ 테스트용 오늘의 리포트 작성 API 변경
🔗 Related Issue
💬 공유사항
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.