|
|
|
@ -4,8 +4,9 @@ import (
|
|
|
|
|
"JISQueueing/common"
|
|
|
|
|
"JISQueueing/db"
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"github.com/gorilla/websocket"
|
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
|
|
"github.com/gorilla/websocket"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var tickets = make(map[common.Ticket]bool)
|
|
|
|
@ -28,7 +29,7 @@ func claimedTicket(ticket common.Ticket, staff common.Staff, table int, who *web
|
|
|
|
|
tickets[ticket] = true
|
|
|
|
|
|
|
|
|
|
jsonTicket, _ := json.Marshal(ticket)
|
|
|
|
|
sendDisplayMessage("claimed " + staff.Username + " " + strconv.Itoa(table) + " " + string(jsonTicket))
|
|
|
|
|
sendDisplayMessage("claimed " + strconv.Itoa(table) + " " + strconv.Itoa(ticket.ID))
|
|
|
|
|
who.WriteMessage(websocket.TextMessage, []byte("success claimed "+string(jsonTicket)))
|
|
|
|
|
for conn, s := range connToStaff {
|
|
|
|
|
if s.Username != staff.Username {
|
|
|
|
|