enter_room.go 508 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
package group_k

import (
	"fmt"
	"hilo-group/_const/redis_key"
)

// 用户进房的key
const (
	UserEnterRoomPrefix   = "uer:"
	UserEnterRoomUserKey  = UserEnterRoomPrefix + "u:${user_id}"
	UserEnterRoomGroupKey = UserEnterRoomPrefix + "g:${user_id}"
)

func GetUserEnterRoomUserKey(userId uint64) string {
	return redis_key.ReplaceKey(UserEnterRoomUserKey, fmt.Sprintf("%d", userId))
}

func GetUserEnterRoomGroupKey(groupId string) string {
	return redis_key.ReplaceKey(UserEnterRoomGroupKey, groupId)
}