go-common/app/service/live/live-dm/dao/white_list.go

23 lines
455 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
"context"
"go-common/library/cache/redis"
"go-common/library/log"
)
//IsWhietListUID 通过UID判读是否是白名单用户
func (d *Dao) IsWhietListUID(ctx context.Context, key string) (isWhite bool) {
conn := d.whitelistredis.Get(ctx)
defer conn.Close()
var err error
isWhite, err = redis.Bool(conn.Do("EXISTS", key))
if err != nil {
log.Error("[DM] GetWhietListByUID redis err:%+v", err)
return true
}
return
}