记录扩展数据
This commit is contained in:
parent
fb40ce3f19
commit
335de3109a
@ -5,8 +5,6 @@ import (
|
|||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"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) {
|
func (this *ModelRecord) GetUserRecord(uid string) (result *pb.DBUserRecord, err error) {
|
||||||
result = &pb.DBUserRecord{}
|
result = &pb.DBUserRecord{}
|
||||||
if err = this.Get(uid, result); err != nil && err != mongo.ErrNoDocuments {
|
if err = this.Get(uid, result); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = nil
|
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ import (
|
|||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"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) {
|
func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) {
|
||||||
result = &pb.DBUserExpand{}
|
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
|
return
|
||||||
}
|
}
|
||||||
err = nil
|
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user