This commit is contained in:
27
server/memorystore/providers/redis/core.go
Normal file
27
server/memorystore/providers/redis/core.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// GetUserProfile возвращает профиль пользователя в виде сырого JSON
|
||||
func (c *provider) GetUserProfile(userId string) (string, error) {
|
||||
key := fmt.Sprintf("user:%s:profile", userId)
|
||||
profileJSON, err := c.store.Get(c.ctx, key).Result()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return profileJSON, nil
|
||||
}
|
||||
|
||||
// GetUserFollows возвращает список подписок пользователя в виде сырого JSON
|
||||
func (c *provider) GetUserFollows(userId string) (string, error) {
|
||||
key := fmt.Sprintf("user:%s:follows", userId)
|
||||
followsJSON, err := c.store.Get(c.ctx, key).Result()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return followsJSON, nil
|
||||
}
|
Reference in New Issue
Block a user