Browse Source

bug: fix

master
小黄 4 years ago
parent
commit
1037cf43f7
  1. 17
      hasaki-push/api_push_message.go

17
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"`
}
Loading…
Cancel
Save