(cmd redis.Cmdable)
| 21 | } |
| 22 | |
| 23 | func NewUserCache(cmd redis.Cmdable) UserCache { |
| 24 | return &userCache{ |
| 25 | cmd: cmd, |
| 26 | expiration: time.Minute * 15, |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | // Get 从redis中获取数据并反序列化 |
| 31 | func (u *userCache) Get(ctx context.Context, uid int64) (domain.User, error) { |