add
This commit is contained in:
@@ -47,6 +47,16 @@ func (h *WsHub) IsStudentOnline(studentRkID int64) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
func (h *WsHub) PushExamToStudent(studentRkID int64, data map[string]any) {
|
||||
h.mu.RLock()
|
||||
client, ok := h.students[studentRkID]
|
||||
h.mu.RUnlock()
|
||||
if !ok || client == nil {
|
||||
return
|
||||
}
|
||||
_ = client.Conn.WriteJSON(SocketMsg{Event: "exam:paper-sent", Data: data})
|
||||
}
|
||||
|
||||
func (h *WsHub) PushChatToStudent(studentRkID int64, data map[string]any) {
|
||||
h.mu.RLock()
|
||||
client, ok := h.students[studentRkID]
|
||||
|
||||
Reference in New Issue
Block a user