From 1037cf43f732cd520aae1a38f4cc6266f962fd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=BB=84?= <1520752231@qq.com> Date: Fri, 19 Mar 2021 14:41:47 +0800 Subject: [PATCH] bug: fix --- hasaki-push/api_push_message.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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"` +}