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