enter_room.go 509 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11
package group_k

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

// 用户进房的key
const (
	UserEnterRoomPrefix   = "uer:"
	UserEnterRoomUserKey  = UserEnterRoomPrefix + "u:${user_id}"
iamhujiebin's avatar
iamhujiebin committed
12
	UserEnterRoomGroupKey = UserEnterRoomPrefix + "g:${group_id}"
hujiebin's avatar
hujiebin committed
13 14 15 16 17 18 19 20 21
)

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)
}