Skip to content

Commit

Permalink
[feat #136] 채팅방 상세 조회 응답에 요청자 여부 필드 추가 (#137)
Browse files Browse the repository at this point in the history
* [feat] : 채팅방 상세 조회 응답에 요청자 여부 필드 추가

* [test] : 채팅방 상세 조회 시 요청자 여부 반환 테스트 반영
  • Loading branch information
hyun2371 authored Nov 6, 2024
1 parent 6a980c5 commit 20337bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/dnd/gongmuin/chat/dto/ChatRoomMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static ChatRoomDetailResponse toChatRoomDetailResponse(
Member chatPartner
) {
QuestionPost questionPost = chatRoom.getQuestionPost();

boolean isInquirer = !chatPartner.equals(chatRoom.getInquirer());
return new ChatRoomDetailResponse(
questionPost.getId(),
questionPost.getJobGroup().getLabel(),
Expand All @@ -66,7 +66,8 @@ public static ChatRoomDetailResponse toChatRoomDetailResponse(
chatPartner.getJobGroup().getLabel(),
chatPartner.getProfileImageNo()
),
chatRoom.getStatus().getLabel()
chatRoom.getStatus().getLabel(),
isInquirer
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public record ChatRoomDetailResponse(
String targetJobGroup,
String title,
MemberInfo receiverInfo,
String chatStatus
String chatStatus,
boolean isInquirer
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ void getChatRoomById() throws Exception {
.andExpect(jsonPath("$.receiverInfo.memberId").value(inquirer.getId()))
.andExpect(jsonPath("$.receiverInfo.nickname").value(inquirer.getNickname()))
.andExpect(jsonPath("$.receiverInfo.memberJobGroup").value(inquirer.getJobGroup().getLabel()))
.andExpect(jsonPath("$.receiverInfo.profileImageNo").value(inquirer.getProfileImageNo()));
.andExpect(jsonPath("$.receiverInfo.profileImageNo").value(inquirer.getProfileImageNo()))
.andExpect(jsonPath("$.isInquirer").value(false));
}

@DisplayName("[답변자가 채팅 요청을 수락할 수 있다.]")
Expand Down

0 comments on commit 20337bb

Please sign in to comment.