记录扩展数据

This commit is contained in:
meixiongfeng 2022-08-01 15:14:13 +08:00
parent fb40ce3f19
commit 335de3109a
2 changed files with 3 additions and 8 deletions

View File

@ -5,8 +5,6 @@ import (
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go.mongodb.org/mongo-driver/mongo"
)
// 记录一些扩展数据 图鉴 改名次数等
@ -33,10 +31,9 @@ func (this *ModelRecord) getUserSession(uid string) (cuser *pb.CacheUser) {
//获取用户通过扩展表
func (this *ModelRecord) GetUserRecord(uid string) (result *pb.DBUserRecord, err error) {
result = &pb.DBUserRecord{}
if err = this.Get(uid, result); err != nil && err != mongo.ErrNoDocuments {
if err = this.Get(uid, result); err != nil {
return
}
err = nil
return result, err
}

View File

@ -5,8 +5,6 @@ import (
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go.mongodb.org/mongo-driver/mongo"
)
// 记录一些扩展数据
@ -35,10 +33,10 @@ func (this *ModelExpand) getUserSession(uid string) (cuser *pb.CacheUser) {
//获取用户通过扩展表
func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) {
result = &pb.DBUserExpand{}
if err = this.moduleUser.modelExpand.Get(uid, result); err != nil && err != mongo.ErrNoDocuments {
if err = this.moduleUser.modelExpand.Get(uid, result); err != nil {
return
}
err = nil
return result, err
}