feat(ai): Ask Chat 세션과 히스토리 API 추가#198
Merged
Merged
Conversation
GET /ask-chat/home은 활성 세션 조회만 수행하고, POST /ask-chat/sessions는 활성 세션 재사용 또는 신규 생성을 담당하도록 분리함
POST /ask-chat/messages에서 활성 세션 재사용 또는 신규 세션 생성 후 USER 메시지를 저장하도록 구현함
USER 메시지가 있는 세션만 히스토리 목록에 노출하도록 조회 조건을 변경함
Swagger 설명에 홈/채팅/히스토리 화면별 동작과 세션 생성 여부를 구체화함. AskChatMessageCommandService에서 질문 내용을 공백 제거 후 검증하도록 보강하고, 잘못된 입력이 세션 조회와 메시지 저장 전에 차단되는 테스트를 추가함
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📝 요약(Summary)
주요 변경사항
세션/홈 API
GET /ask-chat/home추가: ACTIVE 세션만 조회하고, 세션이 없으면 생성하지 않음POST /ask-chat/sessions추가: ACTIVE 세션 재사용 또는 신규 세션 생성activeSession하위 DTO만 nullable로 두어 응답 계약을 명확화질문 저장 API
POST /ask-chat/messages추가answeredTurnCount >= 15인 경우ASK_CHAT_TURN_LIMIT_EXCEEDED로 저장 전 차단히스토리 조회
empty,createdDate추가readOnly=true추가Swagger/API 문서
테스트
검증
.\gradlew.bat test --tests "com.devkor.ifive.nadab.domain.askchat.application.AskChatMessageCommandServiceTest" --tests "com.devkor.ifive.nadab.domain.askchat.application.AskChatSessionServiceTest" --tests "com.devkor.ifive.nadab.domain.askchat.application.AskChatHistoryQueryServiceTest".\gradlew.bat test --tests "com.devkor.ifive.nadab.domain.askchat.core.repository.AskChatSessionRepositoryTest" --tests "com.devkor.ifive.nadab.domain.askchat.application.AskChatHistoryQueryServiceTest"git diff --check참고 / 리스크
🔗 Related Issue
💬 공유사항
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.