From 274c63eb5e2b8cf12da6e14f2d4ee96d99888a05 Mon Sep 17 00:00:00 2001 From: AndrewZuo01 Date: Fri, 5 Jan 2024 11:00:24 +0800 Subject: [PATCH] fix type = 0 --- pkg/common/db/mgo/user.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/common/db/mgo/user.go b/pkg/common/db/mgo/user.go index 201a1f0a3..4fd4f0da4 100644 --- a/pkg/common/db/mgo/user.go +++ b/pkg/common/db/mgo/user.go @@ -186,7 +186,13 @@ func (u *UserMgo) GetAllUserCommand(ctx context.Context, userID string) ([]*user Value string `bson:"value"` CreateTime int64 `bson:"createTime"` } - + var documents struct { + Type int64 `bson:"type"` + UUID string `bson:"uuid"` + Value string `bson:"value"` + CreateTime int64 `bson:"createTime"` + } + log.ZDebug(ctx, "usercommandget", document, documents) if err := cursor.Decode(&document); err != nil { return nil, err } @@ -204,7 +210,7 @@ func (u *UserMgo) GetAllUserCommand(ctx context.Context, userID string) ([]*user if err := cursor.Err(); err != nil { return nil, err } - log.ZDebug(ctx, "usercommandget", commands) + return commands, nil } func (u *UserMgo) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) {