refactor:Returns [] an empty array when no platform is online, instead of null (#970)

pull/992/head
pluto 1 year ago committed by GitHub
parent 687614d3f4
commit 6fc15d4f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -244,7 +244,7 @@ func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineS
} }
if newPlatformIDs == nil { if newPlatformIDs == nil {
onlineStatus.Status = constant.Offline onlineStatus.Status = constant.Offline
onlineStatus.PlatformIDs = nil onlineStatus.PlatformIDs = []int32{}
newjsonData, err := json.Marshal(&onlineStatus) newjsonData, err := json.Marshal(&onlineStatus)
if err != nil { if err != nil {
return errs.Wrap(err) return errs.Wrap(err)

Loading…
Cancel
Save