app-data-patch
Some checks failed
deploy / deploy (push) Failing after 5s

This commit is contained in:
2024-02-22 00:29:46 +03:00
parent 2487077adc
commit 871c65b9dd
2 changed files with 56 additions and 0 deletions

View 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
}