### structure
```
|-- app
|-- controller
| |-- v2
| |-- redis.js
|
|-- io
|-- controller
| |-- chat.js
| |-- nsp.js
| |-- sessions.js
|
|-- middleware
| |-- connection.js
| |-- packet.js
|
|-- service
|-- io_sessions.js
|-- redis.js
```
---
### API:
>/v2/redis/getOnlineClients
Method = `POST`
Request body:
```json=
{}
```
Return Payload:
```=json
{
['1', '2', '3']
}
```
---
>/v2/notifications/getNotificationsCount
Method: `post`
Requeset Body:
```=json
{
}
```
Return Payload:
```=json
{
notificationsCount: 10
}
```
---
>/v2/notifications/getSnackBar
Method: `post`
Requeset Body:
```=json
{}
```
Return Payload:
```=json
{
}
```
---
>/v2/notifications/modifyNotification
Method: `post`
Requeset Body:
```=json
{
notifications: [
{
title: 'test',
description: d
},
{
title: 'test1',
description: d1
},
]
}
```
Return Payload:
```=json
{
}
```
---
>/v2/notifications/getUserNotifications
Method: `post`
Requeset Body:
```=json
{
limit: 10,
page: 1
}
```
Return Payload:
```=json
{
notifications: [
{
title: 'test',
description: d
},
{
title: 'test1',
description: d1
},
]
}
```
---
### io event:
Event Name: 'auth'
>*#ffe*
>`this.socket.emit('auth', authToken);`
>*#fbe*
>`this.socket.on('auth', authToken);`
Route: `app.io.of('/').route('auth', app.io.controller.sessions.auth);`
Payload: ex.
```json=
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm92aWRlciI6ImxvY2FsIiwidXNlcl9pZCI6MSwiZGV2aWNlX3V1aWQiOiJESUQtZDg4YWQyOTItYjkyNC00ZGE0LTk0MGQtNDM1MWVlNmI5NzU5IiwidXNlcl9hZ2VudCI6IlBvc3RtYW5SdW50aW1lLzcuMjYuMyIsImFjY2Vzc190b2tlbiI6bnVsbCwiaWF0IjoxNTk5NjM1MjEwfQ.LeSK9xuZhYgWlFTw7A8Baj8we8jGY1k8VktkkPiEWLw
```
---
Event Name: disconnect
>*#ffe*
>`await this.socket.emit('disconnect');`
Route: ` app.io.of('/').route('disconnect',app.io.controller.sessions.disconnect);
`
Payload:
```json=
{}
```
---