Conversation
Closed
bf15513 to
8d7fb4a
Compare
📊 코드 커버리지 리포트
|
minibr
approved these changes
Dec 18, 2025
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 설명
작업 내용
1. API 구현 (
ChatController)GET /v1/chatsChatsRes(채팅방 ID 및 제목 리스트).{ "success": true, "status": "OK", "message": "채팅방 목록 조회 완료", "data": { "chats": [ { "id": 10, "title": "Spring Boot 관련 질문" }, { "id": 9, "title": "JPA 성능 최적화 방법" } ] } }2. 비즈니스 로직 (
Facade&Service)ChatFacade:ChatService를 호출하여 도메인 엔티티를 조회하고,ChatsResDTO로 변환하여 컨트롤러에 반환함.@Transactional(readOnly = true)를 적용하여 조회 성능을 최적화함.ChatService&ChatQueryService:ChatQueryService가 실제 DB 조회를 전담하며,ChatService는 이를 호출하는 구조로 CQS(Command Query Separation)를 준수함.3. Repository (
ChatRepository)findAllByMemberOrderByLastMessageDesc:@Query를 활용하여 채팅방(Chat)과 메시지(Message)를 조인(JOIN)함.GROUP BY)한 뒤, 가장 최근 메시지의 생성일(MAX(m.createdAt))을 기준으로 내림차순 정렬하여 반환함.JOIN(Inner Join)을 사용했으므로 대화 내역(메시지)이 존재하는 채팅방만 조회됨.4. 테스트 작성
ChatControllerIntegrationTest):@AutoConfigureMockMvc를 사용하여 실제 요청 흐름을 시뮬레이션하고, JSON 응답 필드 검증을 수행함.ChatFacadeTest: Service 호출 및 DTO 변환 로직을 Mocking 테스트함.ChatRepositoryTest:DataJpaTest를 통해 멤버별 데이터 격리 및 정렬 조건(생성일 내림차순) 동작을 검증함.