This commit is contained in:
2026-06-30 11:51:34 +07:00
parent fd08bee7ab
commit 0abf48ea2d
28 changed files with 3514 additions and 37 deletions

View File

@@ -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]