Skip to content

Commit

Permalink
Merge pull request #128 from Kusitms-28th-MeetUp-C/feature/127-chat
Browse files Browse the repository at this point in the history
[fix]:Socket 채팅방 생성관련 오류 수정
  • Loading branch information
RyuKwanKon committed Nov 18, 2023
2 parents 9516ef5 + 81a0766 commit 5a11d27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class ChatUser {
private UserType type;

public static ChatUser createChatUser(User user){
System.out.println(user.getUserType());
return ChatUser.builder()
.sessionId(user.getId())
.name(user.getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ private String getReceivedUserName(Chat chat, String user) {

private Chat findFirstChatBySessions(Long firstSessionId, Long secondSessionId) {
Query query = new Query();
query.addCriteria(Criteria.where("sessionList").all(firstSessionId, secondSessionId));
query.addCriteria(Criteria.where("chatUserList.sessionId").all(firstSessionId, secondSessionId));
return mongoTemplate.findOne(query, Chat.class);
}

private List<Chat> findChatListBySession(Long sessionId) {
Query query = new Query();
query.addCriteria(Criteria.where("sessionList").all(sessionId));
query.addCriteria(Criteria.where("chatUserList.sessionId").all(sessionId));
return mongoTemplate.find(query, Chat.class);
}

Expand Down

0 comments on commit 5a11d27

Please sign in to comment.