From 55121656a8b36c7511db5ac0273b6edc55a6b441 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 5 Jun 2024 23:47:41 +0300 Subject: [PATCH] get-id --- server/memorystore/providers/redis/store.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/memorystore/providers/redis/store.go b/server/memorystore/providers/redis/store.go index c22335a..6609673 100644 --- a/server/memorystore/providers/redis/store.go +++ b/server/memorystore/providers/redis/store.go @@ -237,11 +237,12 @@ func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) { } // Преобразуем ID автора из строки в int - var authorId int - err = json.Unmarshal([]byte(authorIdString), &authorId) + var authorIdFloat float64 + err = json.Unmarshal([]byte(authorIdString), &authorIdFloat) if err != nil { return "", err } + authorId := int(authorIdFloat) // Получаем профиль автора из Redis authorProfileString, err := c.store.Get(c.ctx, fmt.Sprintf("author:id:%d", authorId)).Result()