-
Notifications
You must be signed in to change notification settings - Fork 4
소켓 명세서
Kang Minji edited this page Nov 25, 2021
·
12 revisions
io(${url}/team-${teamId});
팀 namespace: /team-teamId(숫자)
Emit (Client → Server)
{
teamId: number;
userId: number;
}
Emit (Client → Server)
users room 참가
Emit (Client → Server)
users room 나가기
Emit (Server→ Client)
{
onlineUsers: { userId: number }[];
}
room이름: chat-{chatId}
Emit (Client → Server)
{
chatRooms: { chatRoomId: number }[]
}
채팅방(chat-room) 참가 요청
Emit (Client → Server)
{
chatRooms: { chatRoomId: number }[];
}
채팅방(chat-chatId) 나가기 요청
Emit (Client → Server)
{
chatRoomId: number;
}
초기 메시지 리스트 요청
Emit (Server → Client)
{
chatRoomId: number;
messageList:
[
{
messageId: number;
content: string;
createdAt: Date;
userId: number;
chatRoomId: number;
},
{
messageId: number;
content: string;
createdAt: Date;
userId: number;
chatRoomId: number;
}
]
}
메세지 리스트 응답
Emit (Server → Client)
{
chatRoomId:
{
messageId: number;
content: string;
createdAt: Date;
userId: number;
chatRoomId: number;
},
chatRoomId:
{
messageId: number;
content: string;
createdAt: Date;
userId: number;
chatRoomId: number;
},
}
최근 메시지 가져오기
Emit (Client → Server)
{
content: string;
userId: number;
chatRoomId: number;
}
메시지 전송
Emit (Server → Client)
in chat-id room
{
messageId: number;
content: string;
userId: number;
createdAt: Date;
chatRoomId: number;
}
메시지 수신
Emit (Client→ Server)
{
chatRoomId: number;
userList: { userId: number }[]
teamId: number;
}
채팅방 생성 알림
Emit (Client → Server)
{
chatRoomId: number;
}
채팅방 나가기 알림
Emit (Client → Server)
{
chatRoomId: number;
}
채팅방 이름 변경 알림
Emit (Client→ Server)
{
chatRoomId: number;
userList: { userId: number }[];
teamId: number;
}
유저 초대 알림
Emit (Server → Client)
Emit (Server → Client)