Skip to content

소켓 명세서

Kang Minji edited this page Nov 23, 2021 · 12 revisions

접속

접속 방법

io(${url}/team-${teamId});

팀 namespace: /team-teamId(숫자)

change status to online

Emit (Client → Server)

{
	teamId: 1,
	userId: '23523464' | '[email protected]',
}

팀 내부 관리

enter users room

Emit (Client → Server)

users room 참가

leave users room

Emit (Client → Server)

users room 나가기

online users

Emit (Server→ Client)

{
	onlineUsers: [{ userId: '23523464' }, { userId: '[email protected]' }]
}

팀 채팅

room이름: chat-{chatId}

enter chat rooms

Emit (Client → Server)

{
	chatRooms: [{ chatRoomId: 1 }, { chatRoomId:2 }]
}

채팅방(chat-room) 참가

leave chat room

Emit (Client → Server)

{
	chatRooms: [{ chatRoomId: 1 }, { chatRoomId:2 }]
}

채팅방(chat-chatId) 나가기

send message

Emit (Client → Server)

{
	content: '내용',
	userId: 1,
	chatRoomId: 1,
}

receive message

Emit (Server → Client)

in chat-id room

{
	messageId: 1,
	content: '내용',
	userId: 1,
	createdAt: Date,
	chatRoomId: 1,
}

invite users

Emit (Client→ Server)

{
	chatRoomId: 1,
	userList: [{ userId: 1 }, { userId: 2 }]
	teamId: 1,
}

update chat room name

Emit (Client → Server)

{
	chatRoomId: 1,
}

refresh chat rooms

Emit (Server → Client)

refresh chat room users

Emit (Server → Client)

exit chat room

Emit (Client → Server)

{
	chatRoomId: 1,
}

팀 보드

Clone this wiki locally