refactor(ai): Ask Chat 화면 계약 및 집계 로직 정리 - #206
Merged
Merged
Conversation
Ask Chat 대화권 10회 충전에 필요한 크리스탈 비용을 30에서 200으로 변경하고, Swagger 설명과 응답 예시 및 관련 테스트 기대값을 함께 갱신
GET /ask-chat/home 응답을 홈 화면에 필요한 remainingMessageCount, nickname, crystalBalance, sampleQuestions 중심으로 재구성하고, 예시 질문을 ask_chat_sample_questions 테이블과 interests.code 기반 category 응답으로 관리하도록 정리
AskChatTurnChargeResponse에서 충전 수량, 차감 크리스탈, 무료/유료 대화권 세부 잔액을 제거하고 crystalBalance와 remainingMessageCount만 반환하도록 정리
POST /ask-chat/sessions에서 첫 질문 content를 함께 받아 새 세션 생성 후 AskChatMessageCommandService.sendQuestion 흐름을 재사용하도록 변경하고, AskChatSessionResponse에서 createdAt과 endedAt 제거
GET /ask-chat/histories/{sessionId} 응답의 readOnly를 고정값이 아닌 세션 상태와 answeredTurnCount 기준으로 계산하도록 수정
누적 답변 20개 이상 조건을 POST /ask-chat/sessions가 아닌 GET /ask-chat/home에서 검증하도록 이동하고 Swagger 설명과 서비스 테스트를 갱신
성공 답변 후 answeredTurnCount 갱신을 엔티티 dirty checking이 아닌 명시적 update query로 처리하고, 갱신된 세션을 재조회하도록 수정해 bulk update 이후 세션 집계가 누락되는 문제를 보정
Collaborator
|
코드 보니까 노력의 흔적이 보입니다! 진짜 고생하셨어요!!!! 머지 고고~ |
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)
answered_turn_count)가 실제 DB에 반영되지 않던 문제를 보정했습니다.주요 변경사항
Ask Chat 홈/세션 API
GET /ask-chat/home응답을 남은 메시지 수, 닉네임, 크리스탈 수, 예시 질문 중심으로 재구성POST /ask-chat/sessions에서 최초 질문 입력과 세션 생성을 함께 처리하도록 변경예시 질문 저장소
ask_chat_sample_questions테이블 및 Flyway 마이그레이션 추가히스토리 응답 정리
empty,answeredTurnCount,createdAt필드 제거readOnly값을 세션 상태와 15회 제한 기준으로 계산대화권/크리스탈 응답
crystalBalance,remainingMessageCount중심으로 축소집계 안정성
answered_turn_count를 명시적 update query로 갱신테스트
🔗 Related Issue
💬 공유사항
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.