websotckt
This commit is contained in:
@@ -94,6 +94,9 @@ func (c *EventController) TestWebsocket() {
|
|||||||
)
|
)
|
||||||
//将当前客户端放入map中
|
//将当前客户端放入map中
|
||||||
messageGroups, _ := dao.GetUserMessageGroups(dao.GetDB(), userID)
|
messageGroups, _ := dao.GetUserMessageGroups(dao.GetDB(), userID)
|
||||||
|
if len(messageGroups) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, v := range messageGroups {
|
for _, v := range messageGroups {
|
||||||
clients[v.GroupID] = append(clients[v.GroupID], ws)
|
clients[v.GroupID] = append(clients[v.GroupID], ws)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user