|
|
@@ -32,7 +32,7 @@ func (c *groupCache) Get(groupId int64) (*model.Group, error) { |
|
|
|
// GetLimit 获取群组缓存 |
|
|
|
func (c *groupCache) GetLimit(limit string, groupId int64) (*model.Group, error) { |
|
|
|
var user model.Group |
|
|
|
err := db.RedisUtil.Get(GroupKey+limit+strconv.FormatInt(groupId, 10), &user) |
|
|
|
err := db.RedisUtil.Get(GroupKey+limit+":"+strconv.FormatInt(groupId, 10), &user) |
|
|
|
if err != nil && err != redis.Nil { |
|
|
|
return nil, gerrors.WrapError(err) |
|
|
|
} |
|
|
@@ -53,7 +53,7 @@ func (c *groupCache) Set(group *model.Group) error { |
|
|
|
|
|
|
|
// SetLimit 设置群组缓存 |
|
|
|
func (c *groupCache) SetLimit(limit string, group *model.Group) error { |
|
|
|
err := db.RedisUtil.Set(GroupKey+limit+strconv.FormatInt(group.Id, 10), group, 24*time.Hour) |
|
|
|
err := db.RedisUtil.Set(GroupKey+limit+":"+strconv.FormatInt(group.Id, 10), group, 24*time.Hour) |
|
|
|
if err != nil { |
|
|
|
return gerrors.WrapError(err) |
|
|
|
} |
|
|
|