type-fix-5
This commit is contained in:
parent
8deba4849d
commit
132f965c8b
|
@ -246,10 +246,26 @@ func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) {
|
||||||
authorFollowers := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:followers`, authorId))
|
authorFollowers := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:followers`, authorId))
|
||||||
|
|
||||||
// Combine user data into a JSON string
|
// Combine user data into a JSON string
|
||||||
combinedData := fmt.Sprintf(`{"profile": %s, "authors": %s, "topics": %s, "followers": %s}`,
|
combinedData := "{"
|
||||||
authorProfileString, authorFollowsAuthorsString, authorFollowsTopicsString, authorFollowers)
|
|
||||||
|
|
||||||
log.Printf("%v", combinedData)
|
if authorProfileString != nil {
|
||||||
|
combinedData += fmt.Sprintf(`"profile": %s`, authorProfileString)
|
||||||
|
}
|
||||||
|
|
||||||
|
if authorFollowsAuthorsString != nil {
|
||||||
|
combinedData += fmt.Sprintf(`,"authors": %s`, authorFollowsAuthorsString)
|
||||||
|
}
|
||||||
|
|
||||||
|
if authorFollowsTopicsString != nil {
|
||||||
|
combinedData += fmt.Sprintf(`,"topics": %s`, authorFollowsTopicsString)
|
||||||
|
}
|
||||||
|
|
||||||
|
if authorFollowers != nil {
|
||||||
|
combinedData += fmt.Sprintf(`,"followers": %s`, authorFollowers)
|
||||||
|
}
|
||||||
|
|
||||||
|
combinedData += "}"
|
||||||
|
// log.Printf("%v", combinedData)
|
||||||
|
|
||||||
return combinedData, nil
|
return combinedData, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user