diff --git a/hasaki-push/api_push_message.go b/hasaki-push/api_push_message.go index 7b7538f..8b82cb4 100644 --- a/hasaki-push/api_push_message.go +++ b/hasaki-push/api_push_message.go @@ -40,3 +40,20 @@ type MessageHandler func(session *melody.Session, message []byte) func SetMessageHandler(messageType string, f MessageHandler) { messageHandlerMap.Store(messageType, f) } + +// LOGIN +type SessionType string + +const ( + Unknown SessionType = "unknown" // 未知 + PadType SessionType = "pad" // 平板 + AdminType SessionType = "admin" // 管理员 + UserType SessionType = "user" // 用户 + CoachType SessionType = "coach" // 教练 +) + +type Session struct { + *melody.Session + Type SessionType `json:"type"` + UserId int `json:"user_id"` +}