Skip to content

Commit

Permalink
fix : isNego ์ถ”๊ฐ€
Browse files Browse the repository at this point in the history
  • Loading branch information
sungjiwoon committed Jan 27, 2024
1 parent 145b77f commit 70fb8f0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class ChatRoomListGetResponse implements Serializable {

private ChatMessageDto lastChatmessageDto;

private Boolean isNego;


public void updateChatMessageDto(ChatMessageDto chatMessageDto) {
this.lastChatmessageDto = chatMessageDto;
Expand All @@ -53,10 +55,31 @@ public void changePartnerInfo() {
this.myNickName = partnerNickName;
this.partnerNickName = tmp;

if (loginUserIdentity.equals(UserIdentity.SELLER)) {
if (this.loginUserIdentity.equals(UserIdentity.SELLER)) {
this.loginUserIdentity = UserIdentity.BUYER;
} else if (loginUserIdentity.equals(UserIdentity.BUYER)) {
} else if (this.loginUserIdentity.equals(UserIdentity.BUYER)) {
this.loginUserIdentity = UserIdentity.SELLER;
}
}

@Override
public String toString() {
return "ChatRoomListGetResponse{" +
"chatRoomNumber='" + chatRoomNumber + '\'' +
", buyerId=" + buyerId +
", sellerId=" + sellerId +
", productId=" + productId +
", accommodationName='" + accommodationName + '\'' +
", sellPrice=" + sellPrice +
", loginUserIdentity=" + loginUserIdentity +
", accommodationUrl='" + accommodationUrl + '\'' +
", myNickName='" + myNickName + '\'' +
", partnerNickName='" + partnerNickName + '\'' +
", dealState=" + dealState +
", buyerState=" + buyerState +
", sellerState=" + sellerState +
", lastChatmessageDto=" + lastChatmessageDto +
", isNego=" + isNego +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ private void setNewChatRoomInfo(ChatMessageDto chatMessage, ChatRoomListGetRespo
newChatRoomListResponse.changePartnerInfo(); //๋‹‰๋„ค์ž„ ์ฒด์ธ์ง€
chatRoomRedisRepository.setChatRoom(newChatRoomListResponse.getBuyerId(), chatMessage.getRoomId(), newChatRoomListResponse);

} else {
} else if (newChatRoomListResponse.getLoginUserIdentity().equals(UserIdentity.BUYER)){
if (!chatMessage.getType().equals(MessageType.DELETE)) {
chatRoomRedisRepository.setChatRoom(newChatRoomListResponse.getBuyerId(),
chatMessage.getRoomId(), newChatRoomListResponse);
}

newChatRoomListResponse.changePartnerInfo(); //๋‹‰๋„ค์ž„ ์ฒด์ธ์ง€
chatRoomRedisRepository.setChatRoom(newChatRoomListResponse.getSellerId(), chatMessage.getRoomId(), newChatRoomListResponse);
}
Expand Down

0 comments on commit 70fb8f0

Please sign in to comment.