Merged
Conversation
Closed
📊 코드 커버리지 리포트
|
0531575 to
80128fe
Compare
minibr
approved these changes
Dec 18, 2025
src/main/java/com/sofa/linkiving/domain/chat/service/ChatCommandService.java
Outdated
Show resolved
Hide resolved
3bc2a2b to
afad2ff
Compare
afad2ff to
d66d24c
Compare
d66d24c to
656eff7
Compare
656eff7 to
814a641
Compare
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.
관련 이슈
PR 설명
POST /v1/chats) 구현title)을 자동 저장하도록 Entity 구조를 개선작업 내용
1. API 명세 구현 (
ChatController,ChatApi)POST /v1/chatsCreateChatReq(첫 대화 내용 포함,@NotBlank검증).CreateChatRes(생성된 채팅방 ID, 제목, 첫 대화 내용 반환).Request Example
{ "firstChat": "AI 관련 최신 뉴스 알려줘" }Response Example
{ "success": true, "status": "OK", "message": "채팅방 생성 완료", "data": { "id": 1, "title": "임시 제목[AI 관련 최신 뉴스 알려줘]", "firstChat": "AI 관련 최신 뉴스 알려줘" } }2. 비즈니스 로직 (
ChatFacade,ChatService)ChatFacade가 컨트롤러와 서비스 계층 사이에서 트랜잭션과 객체 변환을 조율Member)와 첫 대화 내용(firstChat) 받음ChatService를 통해 채팅방 생성ChatCommandService가ChatRepository를 호출하여 DB에 저장Chat엔티티를CreateChatResDTO로 변환하여 반환3. Entity 수정 (
Chat)title필드 추가: 채팅방의 제목을 저장하기 위해String title필드를 추가했습니다.firstChat내용을 초기 제목으로 설정하여 객체를 생성하도록 빌더를 구성했습니다.4. 테스트 작성 (통합 및 유닛 테스트)
ChatControllerIntegrationTest):ChatFacadeTest: Facade 계층에서ChatService호출 흐름과 DTO 변환 로직을 검증했습니다.ChatServiceTest:ChatCommandService로 저장 로직이 정상적으로 위임되는지 단위 테스트를 수행했습니다.